Adding global attribute using xarray
I would add here that both Datasets and DataArrays can have attributes, both called with .attrs
e.g.
ds.attrs['global attr'] = 25
ds.variable_2.attrs['variable attr'] = 10
ds.variable_2.attrs['variable attr'] = 10
Is there some way to add a global attribute to a netCDF file using xarray? When I do something like hndl_nc['global_attribute'] = 25, it just adds a new variable.