metobs_toolkit.analysis.Analysis.aggregate_df#

Analysis.aggregate_df(obstype: str = 'temp', agg: list[str] = ['LCZ', 'hour'], method: ~typing.Callable = <function nanmean>) DataFrame[source]#

Aggregate all ‘values’ to specific groups and return the resulting DataFrame.

Parameters:
  • obstype (str, optional) – The target observation type to aggregate, by default “temp”.

  • agg (list of str, optional) – List of column names to group by for aggregation, by default [“LCZ”, “hour”].

  • method (callable, optional) – Aggregation method to apply, by default np.nanmean.

Returns:

A DataFrame with aggregated values, indexed by the specified grouping columns.

Return type:

pd.DataFrame