You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this qualifies as a bug, but it is a change that occurred between 0.13.1 and 0.14.1. In 0.14.1, if I have a DataFrame with a column named 'labels', I get the following error when trying to access it as an attribute of the DataFrame:
>>> df = pandas.DataFrame(columns=['labels'])
>>> df['labels']
Series([], name: labels, dtype: object)
>>> df.labels
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/<virtual_env>/local/lib/python2.7/site-packages/pandas/core/generic.py", line 1836, in __getattr__
return object.__getattribute__(self, name)
AttributeError: 'DataFrame' object has no attribute 'labels'
In 0.13.1, this code did not throw an error. This is with Python 2.7.6.
The text was updated successfully, but these errors were encountered:
Their are a couple of 'reserved' names that are checked before the actual column names (this is done for efficiency). This could technically be avoided, but would require a bit of code to do that.
e.g.
index,major_axis,minor_axis,items,labels iow the names of the axes.
So these work with df['index'] but not attribute access.
I'm not sure if this qualifies as a bug, but it is a change that occurred between 0.13.1 and 0.14.1. In 0.14.1, if I have a DataFrame with a column named 'labels', I get the following error when trying to access it as an attribute of the DataFrame:
In 0.13.1, this code did not throw an error. This is with Python 2.7.6.
The text was updated successfully, but these errors were encountered: