-
-
Notifications
You must be signed in to change notification settings - Fork 19k
Avoid reindexing values assigned to a multi-index when cols_droplevel contains empty values #62404
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
base: main
Are you sure you want to change the base?
Conversation
doc/source/whatsnew/v3.0.0.rst
Outdated
- Bug in :class:`DataFrame` arithmetic operations in case of unaligned MultiIndex columns (:issue:`60498`) | ||
- Bug in :class:`DataFrame` arithmetic operations with :class:`Series` in case of unaligned MultiIndex (:issue:`61009`) | ||
- Bug in :meth:`MultiIndex.from_tuples` causing wrong output with input of type tuples having NaN values (:issue:`60695`, :issue:`60988`) | ||
- Bug in :meth:`DataFrame._set_item_frame_value` where column alignment logic would reindex the assigned value with an empty index, incorrectly setting all values to ``NaN``.(:issue:`61841`) |
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 :meth:`DataFrame._set_item_frame_value` where column alignment logic would reindex the assigned value with an empty index, incorrectly setting all values to ``NaN``.(:issue:`61841`) | |
- Bug in :meth:`DataFrame.__setitem__` where column alignment logic would reindex the assigned value with an empty index, incorrectly setting all values to ``NaN``.(:issue:`61841`) |
doc/source/whatsnew/v3.0.0.rst
Outdated
MultiIndex | ||
^^^^^^^^^^ | ||
- :func:`DataFrame.loc` with ``axis=0`` and :class:`MultiIndex` when setting a value adds extra columns (:issue:`58116`) | ||
- :func:`MultiIndex.get_level_values` accessing a :class:`DatetimeIndex` does not carry the frequency attribute along (:issue:`58327`, :issue:`57949`) |
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.
Why did all these other entries move?
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.
pre-commit has a check called "sort whatsnew entries alphabetically" so I assumed they need to be sorted, I'll revert the sort
df2 = DataFrame([[i] for i in range(3)], columns=cols) | ||
df3 = DataFrame([[i] for i in range(3)], columns=cols) | ||
s1 = df1["A"].rolling(2).mean() | ||
s2 = df2["A"].rolling(2).mean() | ||
s3 = df3["A"].rolling(2).mean() |
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.
Could you just create these duplicates with .copy()
?
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.
Sure, I'm just a bit paranoid about anything named "copy" in Python because implementing a proper deep-copy can be challenging.
604485a
to
53c80b9
Compare
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.