Menambahkan atribut dan metadata ke dataset menggunakan 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