-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
Conversation
orient
argument and split
option to to_dict
. (GH7840)
@rpetchler ok! pls add a release note in v0.15.0 (in the deprection section) and we can get this in. |
orient : str {'dict', 'list', 'series', 'split', 'records'} | ||
Determines the type of the values of the dictionary. | ||
|
||
- dict (default) : dict like {column -> {index -> value}} |
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.
@jorisvandenbossche how is this formatting?
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.
yep, that is good
the blank line is indeed needed to have the list rendered as a list
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.
only, there is no indentation needed for the list relative from the Determines ....
DOC: warning about copying for df.append/concat. Fixes #7967
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.
…into to_dict_gh7840
Hmm... squashed the commits but accidentally merged as well. Advice on how to undo all this? Thanks for your patience-- |
|
For the rest looking good! |
merged via 5995dc3 @rpetchler I squashed and merged it. thanks! |
Follows up from #8486 in 0.15.0 by removing outtype in DataFrame.to_dict()
Follows up from pandas-dev#8486 in 0.15.0 by removing outtype in DataFrame.to_dict()
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
.