polartoolkit.block_reduce#
- block_reduce(df, reduction, input_coord_names=('x', 'y'), input_data_names=None, **kwargs)[source]#
perform a block reduction of a dataframe.
- Parameters:
df (pandas.DataFrame) โ data to block reduce
reduction (Callable) โ function to use in reduction, e.g. np.mean
input_coord_names (tuple[str, str], optional) โ strings of coordinate column names, by default (โxโ, โyโ) or (โeastingโ, โnorthingโ)
input_data_names (Any | None, optional) โ strings of data column names, by default None
kwargs (
Any)
- Returns:
a block-reduced dataframe
- Return type: