-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Lose the index before 'na_value' assignment in 'to_numpy' #45775
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
Lose the index before 'na_value' assignment in 'to_numpy' #45775
Conversation
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.
Please add tests. Also this broke existing tests
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.
tests pls
doc/source/whatsnew/v1.5.0.rst
Outdated
@@ -286,7 +286,7 @@ Missing | |||
|
|||
MultiIndex | |||
^^^^^^^^^^ | |||
- | |||
- Bug in :meth:`IndexOpsMixin.to_numpy` where multiindexed Series could not be converted to numpy arrays when an ``na_value`` was supplied (:issue:`45774`) |
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.
the note would need to be user facing
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.
What do you mean by this comment? I do not understand completely what "needs to be user facing" means. 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.
Hey @jreback . May you please elaborate on your 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.
IndexOpsMixin
is private, this is not exposed through the api
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.
Comment should be addressed.
…andas into multiindex_to_numpy
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.
pls merge master as well
thanks @DamianBarabonkovQC |
na_value
supplied #45774doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.This Pull Request addresses the issue where casting a multi-indexed Series
to_numpy
fails if anna_value
is supplied. See the issue #45774 for more information.The choice to use
asanyarray
over other solutions to lose the index is one based on performance and simplicity. The following simple benchmark was used to make this determination:This demonstrates that there is no significant overhead to using the
to_numpy
operation.