-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
API/ENH: stata export should better support np.datetime64 based times #4558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Here's the example from the tests
|
Thanks for the example. The difference here seems to be, that the datetime64 data is contained as a data column and not as table index. Unfortunately this dataframe.to_stata('out', {'index':'tc'}) does not help in my example. |
yep I agree....does this cause a failing test for you? |
No, I just found this behaviour while looking to reproduce another problem. |
ok...great |
This occurs because the column has no name, and so it by default named This works correctly; timestamps = pd.date_range(np.datetime64('2013-01-01 11:00:00.123456'),
periods=5, freq='123U')
dataframe = pd.DataFrame(np.random.randn(len(timestamps)), index=timestamps,
columns=['something'])
dataframe.to_stata('out', convert_dates={'index': 'tc'}) |
is it s problem to have numeric column labels in general? |
Dunno, working through this now - I think the fix will be simple and won't cause an issue. |
PR #6622 No test yet, but too late over here to write a sensible test tonight. |
The following code exporting a dataframe with a timeseries index with np.datetime64 type
throws a
It would be very nice if np.datetime64 (and thus pd.Timestamp as well) would be supported here.
The text was updated successfully, but these errors were encountered: