Skip to content

Implement timedeltas for to_json #9028

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

Merged
merged 2 commits into from
Dec 7, 2014
Merged

Implement timedeltas for to_json #9028

merged 2 commits into from
Dec 7, 2014

Conversation

cpcloud
Copy link
Member

@cpcloud cpcloud commented Dec 6, 2014

Closes #9027

@cpcloud cpcloud self-assigned this Dec 6, 2014
@cpcloud cpcloud added this to the 0.15.2 milestone Dec 6, 2014
@cpcloud cpcloud added Bug IO Data IO issues that don't fit into a more specific label IO JSON read_json, to_json, json_normalize labels Dec 6, 2014
'b': [1, 2]})
result = pd.read_json(frame.to_json())
result['a'] = pd.to_timedelta(result.a, unit='ns')
assert_frame_equal(frame, result)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add a Timestamp in there as well for the test?

@cpcloud
Copy link
Member Author

cpcloud commented Dec 7, 2014

@jreback refactored to have a single total_seconds function in datetime_helper.h

@jreback
Copy link
Contributor

jreback commented Dec 7, 2014

cool rebase and merge in green

@jreback
Copy link
Contributor

jreback commented Dec 7, 2014

looks good. ready to merge?

cpcloud added a commit that referenced this pull request Dec 7, 2014
Implement timedeltas for to_json
@cpcloud cpcloud merged commit c0a79e1 into pandas-dev:master Dec 7, 2014
@cpcloud cpcloud deleted the timedelta-json branch December 7, 2014 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug IO Data IO issues that don't fit into a more specific label IO JSON read_json, to_json, json_normalize
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: to_json failing on mixed with Timedelta
2 participants