Skip to content

Commit c3a3ed3

Browse files
committed
DOC: add sub-levels to reshaping.rst
1 parent b6121b7 commit c3a3ed3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

doc/source/reshaping.rst

+9
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ the level numbers:
162162
163163
.. _reshaping.stack_multiple:
164164

165+
Multiple Levels
166+
~~~~~~~~~~~~~~~
167+
165168
You may also stack or unstack more than one level at a time by passing a list
166169
of levels, in which case the end result is as if each level in the list were
167170
processed 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+
191197
These functions are intelligent about handling missing data and do not expect
192198
each subgroup within the hierarchical index to have the same set of labels.
193199
They 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+
213222
Unstacking when the columns are a ``MultiIndex`` is also careful about doing
214223
the right thing:
215224

0 commit comments

Comments
 (0)