Skip to content

BUG: Panel indexing with partial setting #10839

Closed
@jreback

Description

@jreback

xref #10360 / #10838

takes care of full slices, e.g. p.iloc[0,0,:] = [1,2,3], but the following is still failing
(whether mixed blocks or not)

In [8]: axes = dict(items = pd.MultiIndex.from_tuples([('A','a'), ('B','b')]), major_axis = pd.MultiIndex.from_tuples([('A',1),('A',2)]), minor_axis=pd.MultiIndex.from_product([['X'],range(3)]))

In [9]: p = Panel(0., **axes)


In [11]: p
Out[11]: 
<class 'pandas.core.panel.Panel'>
Dimensions: 2 (items) x 2 (major_axis) x 3 (minor_axis)
Items axis: (A, a) to (B, b)
Major_axis axis: (A, 1) to (A, 2)
Minor_axis axis: (X, 0) to (X, 2)

In [13]: p.iloc[0,0,1:3]
Out[13]: 
X  1    0
   2    0
Name: (A, 1), dtype: float64

In [14]: p.iloc[0,0,1:3] = [1,2]
IndexError: tuple index out of range

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIndexingRelated to indexing on series/frames, not to indexes themselvesMultiIndex

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions