Skip to content

'labels' as a DataFrame column name in version 0.14.1 #8082

Closed
@FragLegs

Description

@FragLegs

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions