File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -162,6 +162,9 @@ the level numbers:
162162
163163 .. _reshaping.stack_multiple :
164164
165+ Multiple Levels
166+ ~~~~~~~~~~~~~~~
167+
165168You may also stack or unstack more than one level at a time by passing a list
166169of levels, in which case the end result is as if each level in the list were
167170processed individually.
@@ -188,6 +191,9 @@ not a mixture of the two).
188191 # from above is equivalent to:
189192 df.stack(level = [1 , 2 ])
190193
194+ Missing Data
195+ ~~~~~~~~~~~~
196+
191197These functions are intelligent about handling missing data and do not expect
192198each subgroup within the hierarchical index to have the same set of labels.
193199They also can handle the index being unsorted (but you can make it sorted by
@@ -210,6 +216,9 @@ which level in the columns to stack:
210216 df2.stack(' exp' )
211217 df2.stack(' animal' )
212218
219+ With a MultiIndex
220+ ~~~~~~~~~~~~~~~~~
221+
213222Unstacking when the columns are a ``MultiIndex `` is also careful about doing
214223the right thing:
215224
You can’t perform that action at this time.
0 commit comments