8000 Allow pandas DataFrames through norms by dstansby · Pull Request #14002 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Allow pandas DataFrames through norms #14002

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 1 commit into from
May 4, 2019

Conversation

dstansby
Copy link
Member

Fixes #10909, and allows Norm objects to be called with Pandas DataFrames. I think the change still works fine with other types of array subclasses, will see if the tests pass. If they do I will add a pandas test.

@efiring
Copy link
Member
efiring commented Apr 22, 2019

The change looks reasonable, but I'm a little worried about the motivation: How far down in the library hierarchy should we be aiming and claiming to support structures like DataFrames?

@anntzer
Copy link
Contributor
anntzer commented Apr 23, 2019

Indeed, I made the same comment at #10909 (comment).

@timhoffm
Copy link
Member
timhoffm commented Apr 23, 2019

I don't care much either way in this particular case. But if we jump the extra hoop with np.ma.getdata, it should be commented in the source code why we do it.

NB: If this is followed up, please rebase to fix the numpydoc-v0.9 related doc failure.

@dstansby
Copy link
Member Author

I'm also happy either way, but if we're going to disallow it I think it should raise a sensible error message.

Copy link
Member
@efiring efiring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can see, the change here has no effect on the handling of masked arrays, so it is a reasonable simplification. I accept it on that basis. Accepting DataFrames here should be viewed as a side-effect, not a commitment.

@anntzer anntzer merged commit 088ed59 into matplotlib:master May 4, 2019
@dstansby dstansby deleted the pandas-norm branch May 4, 2019 19:25
@QuLogic QuLogic added this to the v3.2.0 milestone May 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calling a Normalize instance with a DataFrame
5 participants
0