Created
June 10, 2016 03:25
-
-
Save mdengler/c53d77c92f6db9c2aab7bc59af655fb2 to your computer and use it in GitHub Desktop.
panel4d iloc and slices?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> p4 = pd.Panel4D({i: pd.Panel({j: pd.DataFrame(range(10)) for j in range(10)}) for i in range(10)}) | |
>>> p4.iloc[:,:,0] | |
<class 'pandas.core.panel.Panel'> | |
Dimensions: 10 (items) x 10 (major_axis) x 1 (minor_axis) | |
Items axis: 0 to 9 | |
Major_axis axis: 0 to 9 | |
Minor_axis axis: 0 to 0 | |
>>> p4.iloc[slice(None), slice(None), slice(0)] | |
<class 'pandas.core.panelnd.Panel4D'> | |
Dimensions: 10 (labels) x 10 (items) x 0 (major_axis) x 1 (minor_axis) | |
Labels axis: 0 to 9 | |
Items axis: 0 to 9 | |
Major_axis axis: None | |
Minor_axis axis: 0 to 0 |
Thanks to papna on #pydata:
>>> p4.iloc[slice(None), slice(None), 0]
<class 'pandas.core.panel.Panel'>
Dimensions: 10 (items) x 10 (major_axis) x 1 (minor_axis)
Items axis: 0 to 9
Major_axis axis: 0 to 9
Minor_axis axis: 0 to 0
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pandas 0.14.1, if it makes a difference