Skip to content

AttributeError Block.items #17159

Closed
@jbrockmendel

Description

@jbrockmendel

https://github.com/pandas-dev/pandas/blob/master/pandas/core/internals.py#L326

core.internals.Block references self.items. AFAICT items is an attribute of BlockManager, does not exist in Block.

ser = pd.Series(range(5))
mgr = ser._data
block = mgr.blocks[0]
>>> block.get(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/pandas/core/internals.py", line 329, in get
    loc = self.items.get_loc(item)
AttributeError: 'IntBlock' object has no attribute 'items'

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