Skip to content

DataFrame to dict with index orientation. #10844

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

Closed

Conversation

gabrielaraujof
Copy link
Contributor

The method DataFrame.to_dict didn't have an option for index orientation unlike its cousin to_json, which does have.

@jreback
Copy link
Contributor

jreback commented Aug 18, 2015

hmm, seems resonable. can you add a note in whatsnew / enhancements. (also add a versionadded tag in the doc-string).

@jreback jreback added Reshaping Concat, Merge/Join, Stack/Unstack, Explode Output-Formatting __repr__ of pandas objects, to_string API Design labels Aug 18, 2015
@jreback jreback added this to the 0.17.0 milestone Aug 18, 2015
@gabrielaraujof gabrielaraujof force-pushed the frame-to-dict-index branch 2 times, most recently from 44a4342 to e7f47ce Compare August 19, 2015 23:35
@gabrielaraujof
Copy link
Contributor Author

Just added the note and the versionadded tag you asked. Should I've opened an issue before submit the pull request?
I was using pandas in a project and noticed the enhancement that method could have. Then I just thought in contribute, but I was unaware of the conventions.

@@ -174,6 +174,8 @@ Other enhancements

- ``msgpack`` submodule has been updated to 0.4.6 with backward compatibility (:issue:`10581`)

- ``DataFrame.to_dict`` now accepts the *index* option in ``orient`` keyword argument.
Copy link
Contributor

Choose a reason for hiding this comment

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

use this PR number as the issue number

@jreback
Copy link
Contributor

jreback commented Aug 20, 2015

minor corrections. pls squash. ping when green.

jreback pushed a commit that referenced this pull request Aug 21, 2015
…#10844

Added an index orient option for DataFrame.to_dict method.

Updated tests with index option.
@jreback
Copy link
Contributor

jreback commented Aug 21, 2015

merged via 73dcb95

thanks!

@jreback jreback closed this Aug 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Output-Formatting __repr__ of pandas objects, to_string Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants