-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
This fix allows a DataFrame to retain key order from a dictionary #55696
This fix allows a DataFrame to retain key order from a dictionary #55696
Conversation
293d478
to
f605da2
Compare
doc/source/whatsnew/v2.2.0.rst
Outdated
@@ -327,7 +327,7 @@ Datetimelike | |||
- Bug in addition or subtraction of :class:`BusinessDay` offset with ``offset`` attribute to non-nanosecond :class:`Index`, :class:`Series`, or :class:`DataFrame` column giving incorrect results (:issue:`55608`) | |||
- Bug in addition or subtraction of :class:`DateOffset` objects with microsecond components to ``datetime64`` :class:`Index`, :class:`Series`, or :class:`DataFrame` columns with non-nanosecond resolution (:issue:`55595`) | |||
- Bug in addition or subtraction of very large :class:`Tick` objects with :class:`Timestamp` or :class:`Timedelta` objects raising ``OverflowError`` instead of ``OutOfBoundsTimedelta`` (:issue:`55503`) | |||
- | |||
- Bug in creating a Dataframe using the from_dict method which would alphabetize the rows of the created DataFrame. (:issue:`55683`) |
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.
- Bug in creating a Dataframe using the from_dict method which would alphabetize the rows of the created DataFrame. (:issue:`55683`) | |
- Bug in :meth:`Dataframe.from_dict` which would always sort the rows of the created :class:`DataFrame`. (:issue:`55683`) |
@@ -53,10 +53,10 @@ def test_rename(self, float_frame): | |||
# gets sorted alphabetical |
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 remove this comment?
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.
Just fixed both of these! Thanks for taking a look.
1f85072
to
9dc4a63
Compare
9dc4a63
to
074ab2f
Compare
…h only one column instead of sorting them alphabetically.
Not sure why this Closed. |
Thanks @paulreece |
This fix allows a DataFrame to retain key order from a dictionary with only one column instead of sorting them alphabetically.
Note: I had to change the order for the rename tests in
test_rename.py
but the order there seemed trivial. If I'm wrong in my assumption please let me know. I also had to change the index order of the control df inindexing/multiindex/test_setitem.py
but again this seemed trivial/innocuous change in this circumstance.doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.