I have an xarray dataset with foll. structure:
<xarray.Dataset>
Dimensions: (N: 5, latitude: 360, longitude: 720, time: 27)
Coordinates:
* latitude (latitude) float64 89.75 89.25 88.75 88.25 87.75 87.25 ...
* longitude (longitude) float64 -179.8 -179.2 -178.8 -178.2 -177.8 ...
* time (time) float64 0.0 1.826e+03 3.652e+03 5.479e+03 ...
* N (N) |S1 '1' '2' '3' '4' '5'
I want to copy a handle to this dataset and remove the coordinated named 'N'.
When I do this:
new_nc = hndl_nc.copy()
new_nc.drop('N')
Subsequently, when I try to assign data to new variable in new_nc, it does not work:
new_nc['new_var'] = ...
How do I fix this?