xarray.DataArray.pint.units

DataArray.pint.units

the units of the data or None if not a quantity.

Setting the units is possible, but only if the data is not already a quantity.