-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
Update docs on reserved attributes #20878
Comments
On master,
Did this change recently? If so, we should update the docs. I don't think we would do a warning for this (so e.g. |
Fair enough. I can see that not everyone will use the Interesting that |
Added this as a docs issues. We should update the reserved attr names to be the ones that we're using. |
I can take a stab at it. |
👍 thanks @sharad-vm. Let us know if you get stuck. |
I think was like this before because of Panel4D (which is removed in this version) |
Code Sample, a copy-pastable example if possible
Problem description
I would expect the
labels
column to be accessible as an attribute on the DataFrame, liket.foo
andt.bar
.Instead,
t.labels
gives an AttributeError.I eventually found the relevant section of the docs, which notes that
index
,major_axis
,minor_axis
,items
, andlabels
are reserved.http://pandas.pydata.org/pandas-docs/stable/indexing.html#attribute-access
Expected Output
Given the limitation, I would expect a warning at DataFrame creation time that the
labels
column will not be accessible as an attribute.I see that this issue has been raised before (#8082, #8100) and closed, but I saw no warning. It looks like the only change was to expand the documentation (9b12ccb).
The suggestion from @jtratner on 7 Sep 2014 looked good to me:
Output of
pd.show_versions()
[paste the output of
pd.show_versions()
here below this line]INSTALLED VERSIONS
commit: None
python: 2.7.10.final.0
python-bits: 64
OS: Darwin
OS-release: 17.4.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_GB.UTF-8
LOCALE: None.None
pandas: 0.20.3
pytest: None
pip: 9.0.1
setuptools: 36.4.0
Cython: None
numpy: 1.13.1
scipy: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.6.1
pytz: 2017.2
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: 4.6.0
html5lib: 0.999999999
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.9.6
s3fs: None
pandas_gbq: None
pandas_datareader: 0.5.0
The text was updated successfully, but these errors were encountered: