bach.DataFrame.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.
DataFrameโs index should be of at least two levels to unstack.
Parametersโ
level
(Union[str, int]) โ selects the level of the index that is unstacked.fill_value
(Union[int, numpy.int64, float, numpy.float64, bool, str, None, datetime.date, datetime.time, datetime.datetime, numpy.datetime64, datetime.timedelta, numpy.timedelta64, uuid.UUID, pandas._libs.interval.Interval, dict, list]) โ 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.