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 (
DataFrame) โ data to block reducereduction (
Callable[...,float|int]) โ function to use in reduction, e.g. np.meaninput_coord_names (
tuple[str,str]) โ strings of coordinate column names, by default (โxโ, โyโ) or (โeastingโ, โnorthingโ)input_data_names (
Any|None) โ strings of data column names, by default Nonekwargs (
Any)
- Returns:
a block-reduced dataframe
- Return type: