Skip to content
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: DataFrame.at implicitly assumes unique axes #33041

Closed
jbrockmendel opened this issue Mar 26, 2020 · 1 comment · Fixed by #33047
Closed

BUG: DataFrame.at implicitly assumes unique axes #33041

jbrockmendel opened this issue Mar 26, 2020 · 1 comment · Fixed by #33047
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves
Milestone

Comments

@jbrockmendel
Copy link
Member

jbrockmendel commented Mar 26, 2020

Update: DataFrame.lookup is also affected

arr = np.random.randn(6).reshape(3, 2)
df = pd.DataFrame(arr, columns=["A", "A"])

>>> df.at[0, "A"]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pandas/core/indexing.py", line 2069, in __getitem__
    return super().__getitem__(key)
  File "pandas/core/indexing.py", line 2034, in __getitem__
    return self.obj._get_value(*key, takeable=self._takeable)
  File "pandas/core/frame.py", line 2706, in _get_value
    series = self._get_item_cache(col)
  File "pandas/core/generic.py", line 3550, in _get_item_cache
    res = self._box_item_values(item, values)
  File "pandas/core/frame.py", line 2880, in _box_item_values
    return self._constructor(values.T, columns=items, index=self.index)
AttributeError: 'BlockManager' object has no attribute 'T'

Same problem for df.at.__setitem__. Series.at looks OK.

@jbrockmendel jbrockmendel added Bug Indexing Related to indexing on series/frames, not to indexes themselves labels Mar 26, 2020
@jreback jreback added this to the 1.1 milestone Mar 26, 2020
@simonjayhawkins
Copy link
Member

xref #11754 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants