📅  最后修改于: 2022-03-11 14:47:13.951000             🧑  作者: Mango
#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