-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
ENH: Let initialisation from dicts use insertion order for python >= 3.6 (part III) #19884
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
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,16 +90,16 @@ Series can be instantiated from dicts: | |
|
||
.. note:: | ||
|
||
When the data is a dict, and index is not passed, the Series index | ||
When the data is a dict, and an index is not passed, the ``Series`` index | ||
will be ordered by the dict's insertion order, if you're using Python | ||
version >= 3.6 and Pandas version >= 0.23. | ||
|
||
If you're using Python < 3.6 or Pandas < 0.23, and index is not passed, | ||
the Series index will be the lexically ordered list of dict keys. | ||
If you're using Python < 3.6 or Pandas < 0.23, and an index is not passed, | ||
the ``Series`` index will be the lexically ordered list of dict keys. | ||
|
||
So, in the example above, if you were on a Python version lower than 3.6 or a | ||
Pandas lower than 0.23, the Series would be ordered by the lexical order of the | ||
dict keys (i.e. ['a', 'b', 'c'] rather than ['b', 'a', 'c']). | ||
In the example above, if you were on a Python version lower than 3.6 or a | ||
Pandas version lower than 0.23, the ``Series`` would be ordered by the lexical | ||
order of the dict keys (i.e. ``['a', 'b', 'c']`` rather than ``['b', 'a', 'c']``). | ||
|
||
If an index is passed, the values in data corresponding to the labels in the | ||
index will be pulled out. | ||
|
@@ -264,12 +264,12 @@ based on common sense rules. | |
|
||
.. note:: | ||
|
||
When the data is a dict, and ``columns`` is not specified, the DataFrame | ||
columns will be ordered by the dict's insertion order, if you're using | ||
When the data is a dict, and ``columns`` is not specified, the ``DataFrame`` | ||
columns will be ordered by the dict's insertion order, if you are using | ||
Python version >= 3.6 and Pandas >= 0.23. | ||
|
||
If you're using Python < 3.6 or Pandas < 0.23, and ``columns`` is not | ||
specified, the DataFrame columns will be the lexically ordered list of dict | ||
If you are using Python < 3.6 or Pandas < 0.23, and ``columns`` is not | ||
specified, the ``DataFrame`` columns will be the lexically ordered list of dict | ||
keys. | ||
|
||
From dict of Series or dicts | ||
8000
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
Can you move this note a bit below? It seems strange to start this "from dict" section with a note without first explaining what it actually is.
So I would give an example first, and only afterwards noting that the output depends on the python version