maxframe.dataframe.DataFrame.unstack#
- DataFrame.unstack(level=-1, fill_value=None)#
Unstack, also known as pivot, Series with MultiIndex to produce DataFrame.
- Parameters:
- Returns:
Unstacked Series.
- Return type:
Examples
>>> import maxframe.dataframe as md >>> s = md.Series([1, 2, 3, 4], ... index=md.MultiIndex.from_product([['one', 'two'], ... ['a', 'b']])) >>> s.execute() one a 1 b 2 two a 3 b 4 dtype: int64
>>> s.unstack(level=-1).execute() a b one 1 2 two 3 4
>>> s.unstack(level=0).execute() one two a 1 3 b 2 4