bach.Series.unstack
unstackβ
(level=- 1, fill_value=None, aggregation='max')β[source]
Pivot a level of the index labels.
Returns a(n unsorted) DataFrame with the values of the unstacked index as columns. In case of
duplicate index values that are unstacked, aggregation
is used to aggregate the values.
Seriesβ index should be of at least two levels to unstack.
Parametersβ
level
(Union[int, str]) β selects the level of the index that is unstacked.fill_value
(Optional[Union[int, float, str, uuid.UUID]]) β replace missing values resulting from unstacking. Should be of same type as the series that is unstacked.aggregation
(str) β method of aggregation, in case of duplicate index values. Supports all aggregation methods thataggregate()
supports.
Returnsβ
DataFrame
Return typeβ
note
This function queries the database.