Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
DOC: fix a failing doctest in DataFrame.to_dict #22827
Changes from 1 commit
ecdd114
42b3288
fe9be1d
5438849
0ba11ca
db130ae
4831174
e11abb1
2ecfb6c
64f6050
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Sorry to ask you one more change. Do you mind changing the description of the
Returns
to something more accurate? That is only true with the defaultorient
. Also, it'd be nice to start it with a capital letter and end it with a period. Thanks!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.
No problem, better make it right during this pull request than having to come back later!
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.
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
a
,1
... Using something meaningful would be immediate.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.
@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).
But 'a', 'b' is indeed less clear, but so I would rather call them 'row1', 'row2.
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.
That also makes sense. I'm personally more comfortable with something like
{'cat': {'legs': 4, 'tail': 1}}
than{'row1': {'col1': 0.75, 'col2': 1}}
, but as far as it's not needed to spend a lot of unnecessary time until the example is understood, I'm happy with any option.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.
Sorry to bother you again with the same @Moisan, but do you mind replacing the labels of the rows by
row1
androw2
, instead ofa
andb
? I think that will make the example clearer