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

BUG: df.plot fails when given x,y args as positions #20056

Open
MasonGallo opened this Issue Mar 8, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@MasonGallo
Contributor

MasonGallo commented Mar 8, 2018

Code Sample, a copy-pastable example if possible

from pandas import DataFrame

df = DataFrame({"A": [1, 2], 'B': [3, 4]})
df.plot(x=0, y=1)

Problem description

IndexError: index 1 is out of bounds for axis 0 with size 1

I came across this when writing test cases for my PR #20000 - looks like it happens due to calling set_index on the data rather than on a copy. I can potentially fix it there or open a separate PR.

@gfyoung

This comment has been minimized.

Member

gfyoung commented Mar 8, 2018

Indeed, that does look very odd! Patch is by all means welcome.

(BTW, fine job are securing such a nice, round number for your other PR 😉 )

@MasonGallo

This comment has been minimized.

Contributor

MasonGallo commented Mar 9, 2018

(BTW, fine job are securing such a nice, round number for your other PR 😉 )

I waited for just the right moment :)

I didn't see anywhere in the plotting test cases that tested for integer args so it's possible this slipped through for awhile.

@MasonGallo

This comment has been minimized.

Contributor

MasonGallo commented Mar 15, 2018

I'm going to remove support for integer args in my PR - I think it's confusing to allow both integer & names

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment