-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DOC: fix a failing doctest in DataFrame.to_dict #22827
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
Changes from 1 commit
ecdd114
42b3288
fe9be1d
5438849
0ba11ca
db130ae
4831174
e11abb1
2ecfb6c
64f6050
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1085,7 +1085,8 @@ def to_dict(self, orient='dict', into=dict): | |
|
||
Returns | ||
------- | ||
result : collections.Mapping like {column -> {index -> value}} | ||
collections.Mapping | ||
like {column -> {index -> value}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry to ask you one more change. Do you mind changing the description of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No problem, better make it right during this pull request than having to come back later! |
||
|
||
See Also | ||
-------- | ||
|
@@ -1122,7 +1123,7 @@ def to_dict(self, orient='dict', into=dict): | |
[{'col1': 1.0, 'col2': 0.5}, {'col1': 2.0, 'col2': 0.75}] | ||
|
||
>>> df.to_dict('index') | ||
{'a': {'col1': 1.0, 'col2': 0.5}, 'b': {'col1': 2.0, 'col2': 0.75}} | ||
{'a': {'col1': 1, 'col2': 0.5}, 'b': {'col1': 2, 'col2': 0.75}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm ok merging this and just making the tests pass, but if you want to take care here of making the examples easier to understand, I think it'd be good as in the other strings to use real-world (e.g. animal legs...) examples. From this, it takes a bit to see what's There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @datapythonista I agree with you in general :-), but here I think the 'col1' etc actually makes it easier to see all the different possible output formats (to clearly see where the column names go in the specific output type). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That also makes sense. I'm personally more comfortable with something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry to bother you again with the same @Moisan, but do you mind replacing the labels of the rows by |
||
|
||
You can also specify the mapping type. | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.