Xarray: confused by reference to dataset in docs for xarray.DataArray.copy

Created on 9 Dec 2019  路  2Comments  路  Source: pydata/xarray

The documentation for xarray.DataArray.copy

If deep=True, a deep copy is made of the data array. Otherwise, a shallow copy is made, so each variable in the new array鈥檚 dataset is also a variable in this array鈥檚 dataset.

I do not understand what dataset is being referred to here. In particular, there are no xarray datasets in the examples provided in this documentation. Could someone provide clarification?

documentation help wanted

Most helpful comment

How about

If deep=True, a deep copy is made of the data array. Otherwise, a shallow copy is made, and the returned data array's values are a new view of this data array's values.

All 2 comments

Thanks @klindsay28

We should delete "'s dataset" from that line. The deep kwarg controls whether you get a deep or shallow copy of the variables in the data array (i.e. both coordinate variables and the data variable).

How about

If deep=True, a deep copy is made of the data array. Otherwise, a shallow copy is made, and the returned data array's values are a new view of this data array's values.

Was this page helpful?
0 / 5 - 0 ratings