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
Comment From: jreback
cc @seth-p
what would be really helpful is some more comprehensive testing to find the edge cases with panel (I added some but things take different paths so need to hit them all)
Comment From: seth-p
The example in https://github.com/pydata/pandas/issues/10360#issue-88483152 is still broken as of Pandas 0.18.0.
Comment From: jreback
it's still an open issue
Comment From: jreback
you might find xarray more convenient for representing nd data FYI
Comment From: seth-p
I looked briefly at xarray, and I like it, but I'm not ready to abandon Panels quite yet...
Comment From: jreback
closing as Panels are deprecated