Skip to content
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

[ENH] Add orient argument and split option to to_dict. (GH7840) #8486

Closed
wants to merge 6 commits into from
Closed

[ENH] Add orient argument and split option to to_dict. (GH7840) #8486

wants to merge 6 commits into from

Conversation

rpetchler
Copy link
Contributor

closes #7840

Unlike the implementation offered in #7840, this version preserves the option to pass prefixes to the orient parameter.

I also rewrote the docstring to use the more readable list format from pd.DataFrame.to_json.

@jreback jreback changed the title [ENH] Add orient argument and split option to to_dict. (GH7840) [ENH] Add orient argument and split option to to_dict. (GH7840) Oct 6, 2014
@jreback
Copy link
Contributor

jreback commented Oct 6, 2014

@rpetchler ok!

pls add a release note in v0.15.0 (in the deprection section) and we can get this in.

@jreback jreback added API Design IO JSON read_json, to_json, json_normalize Reshaping Concat, Merge/Join, Stack/Unstack, Explode Output-Formatting __repr__ of pandas objects, to_string labels Oct 6, 2014
@jreback jreback added this to the 0.15.0 milestone Oct 6, 2014
orient : str {'dict', 'list', 'series', 'split', 'records'}
Determines the type of the values of the dictionary.

- dict (default) : dict like {column -> {index -> value}}
Copy link
Contributor

Choose a reason for hiding this comment

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

@jorisvandenbossche how is this formatting?

Copy link
Member

Choose a reason for hiding this comment

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

yep, that is good
the blank line is indeed needed to have the list rendered as a list

Copy link
Member

Choose a reason for hiding this comment

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

only, there is no indentation needed for the list relative from the Determines ....

@jreback
Copy link
Contributor

jreback commented Oct 6, 2014

pls squash: https://github.com/pydata/pandas/wiki/Using-Git

@jorisvandenbossche any other comments?

Update documentation with deprecation and enhancement notices.

Remove indentation from list in docstring.
@rpetchler
Copy link
Contributor Author

Hmm... squashed the commits but accidentally merged as well. Advice on how to undo all this?

Thanks for your patience--

@jreback
Copy link
Contributor

jreback commented Oct 6, 2014

git rebase -i origin/master then delete all the uneeded commits, and f/s the others

@jorisvandenbossche
Copy link
Member

For the rest looking good!

@jreback
Copy link
Contributor

jreback commented Oct 6, 2014

merged via 5995dc3

@rpetchler I squashed and merged it. thanks!

@jreback jreback closed this Oct 6, 2014
@rpetchler rpetchler deleted the to_dict_gh7840 branch October 6, 2014 20:10
jorisvandenbossche pushed a commit that referenced this pull request Jul 12, 2016
Follows up from #8486 in 0.15.0 by removing outtype in DataFrame.to_dict()
nateGeorge pushed a commit to nateGeorge/pandas that referenced this pull request Aug 15, 2016
Follows up from pandas-dev#8486 in 0.15.0 by removing outtype in DataFrame.to_dict()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design IO JSON read_json, to_json, json_normalize 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.

DataFrame to_dict method should also provide orient parameter (like to_json)
3 participants