<jupyter_start><jupyter_text>Aggregation Table of Contents1&nbsp;&nbsp;Aggregation1.1&nbsp;&nbsp;Learning Objectives1.2&nbsp;&nbsp;Aggregation Methods1.3&nbsp;&nbsp;Going Further  Learning Objectives- Perform aggregation (reduction) along one or multiple dimensions of a DataArray or Dataset  Aggregation MethodsXarray supports many of the aggregations methods that numpy has. A partial list includes: all, any, argmax, argmin, max, mean, median, min, prod, sum, std, var.Whereas the numpy syntax would require scalar axes, xarray can use dimension names:<jupyter_code>import xarray as xr
ds = xr.open_dataset("../../../data/air_temperature.nc")
da = ds['air']
da
da.mean()
da.mean(dim=['lat', 'lon'])
da.median(dim='time')
da.std(dim='time')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12435233160621761, 'fraction_numerical': 0.009067357512953367, 'mean_word_length': 6.73, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '666344', 'license': 'CC-BY-4.0', 'n_tokens_mistral': 252, 'n_tokens_neox': 239, 'n_words': 74, 'path': 'notebooks/bytopic/xarray/04_agg.ipynb', 'repo_name': 'jukent/ncar-python-tutorial', 'size': '772'}