-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Error while saving DataFrame with TimedeltaIndex to .csv #10833 #10845
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
Conversation
needs some tests. use the example you gave. add into pls also add a whatsnew note. |
It would be nice to refactor |
df_test.index = pd.to_timedelta(df_test.index) | ||
df_test.index.rename('timestamp', inplace=True) | ||
|
||
self.assertTrue(df_test.equal(df_orig)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could do this, but it is not nearly as imformative as assert_frame_equal
. pls change.
@soupault yes of course |
result = pd.read_csv(path, index_col='dt_index') | ||
result.index = pd.to_timedelta(result.index) | ||
result['dt_data'] = pd.to_timedelta(result['dt_data']) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set the index name for now so this issue is independent
|
||
result = pd.read_csv(path, index_col='dt_index') | ||
result.index = pd.to_timedelta(result.index) | ||
# TODO: remove renaming when GH 10875 is solved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fine, though result.index.name = 'dt_index'
as well
BUG: Error while saving DataFrame with TimedeltaIndex to .csv #10833
thank you sir! |
Fix in accordance with #10833