We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
vibe_df.plot(x='Time', y='Fz') # This works just fine. vibe_df.plot(x='Time', y=['Fz']) # This raises a UserWarning:
I get a UserWarning while plotting a DataFrame. It only occurs if I pass a list of columns for y.
UserWarning is: C:\Program Files\Anaconda3\lib\site-packages\pandas\plotting_core.py:1714: UserWarning: Pandas doesn't allow columns to be created via a new attribute name - see https://pandas.pydata.org/pandas-docs/stable/indexing.html#attribute-access series.name = label
pd.show_versions()
pandas: 0.21.0 pytest: 2.9.2 pip: 9.0.1 setuptools: 27.2.0 Cython: 0.24.1 numpy: 1.11.3 scipy: 1.0.0 pyarrow: None xarray: None IPython: 6.2.1 sphinx: 1.4.6 patsy: 0.4.1 dateutil: 2.6.0 pytz: 2017.2 blosc: None bottleneck: 1.1.0 tables: 3.2.2 numexpr: 2.6.4 feather: None matplotlib: 2.1.0 openpyxl: 2.3.2 xlrd: 1.0.0 xlwt: 1.1.2 xlsxwriter: 0.9.3 lxml: 3.6.4 bs4: 4.5.1 html5lib: None sqlalchemy: 1.0.13 pymysql: None psycopg2: None jinja2: 2.8 s3fs: None fastparquet: None pandas_gbq: None pandas_datareader: None
The text was updated successfully, but these errors were encountered:
This is the line
pandas/pandas/plotting/_core.py
Line 1718 in fdba133
That code pretty clearly assumes that 'y' is a scalar, and that's how it's documented
'y'
Parameters ---------- data : DataFrame x : label or position, default None y : label or position, default None Allows plotting of one column versus another
So we can either validate that data[y] is a Series, and raise if not, or see if we can support and document multiple values for 'y'.
data[y]
btw, here's a reproducible example
In [12]: df = pd.DataFrame({"A": [1, 2], 'B': [3, 4], 'C': [5, 6]}) In [13]: df.plot(x='A', y=['B', 'C'])
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Code Sample, a copy-pastable example if possible
Problem description
I get a UserWarning while plotting a DataFrame. It only occurs if I pass a list of columns for y.
UserWarning is:
C:\Program Files\Anaconda3\lib\site-packages\pandas\plotting_core.py:1714: UserWarning: Pandas doesn't allow columns to be created via a new attribute name - see https://pandas.pydata.org/pandas-docs/stable/indexing.html#attribute-access
series.name = label
Expected Output
Output of
pd.show_versions()
pandas: 0.21.0
pytest: 2.9.2
pip: 9.0.1
setuptools: 27.2.0
Cython: 0.24.1
numpy: 1.11.3
scipy: 1.0.0
pyarrow: None
xarray: None
IPython: 6.2.1
sphinx: 1.4.6
patsy: 0.4.1
dateutil: 2.6.0
pytz: 2017.2
blosc: None
bottleneck: 1.1.0
tables: 3.2.2
numexpr: 2.6.4
feather: None
matplotlib: 2.1.0
openpyxl: 2.3.2
xlrd: 1.0.0
xlwt: 1.1.2
xlsxwriter: 0.9.3
lxml: 3.6.4
bs4: 4.5.1
html5lib: None
sqlalchemy: 1.0.13
pymysql: None
psycopg2: None
jinja2: 2.8
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: