Agregar atributos y metadatos a un conjunto de datos utilizando XArray

#import xarray
import xarray as xr

#open dataset
ds = xr.open_dataset(file_name.nc)

#add attributes and metadata in different ways
ds.attrs = {attribute name : attribute value}
ds.attrs[attribute name] = attribute value
TheRubberDucky