xarray.Variable.copy

Contents

xarray.Variable.copy#

Variable.copy(deep=True, data=None)[source]#

Returns a copy of this object.

If deep=True, the data array is loaded into memory and copied onto the new object. Dimensions, attributes and encodings are always copied.

Use data to create a new object with the same structure as original but entirely new data.

Parameters:
  • deep (bool, default: True) – Whether the data array is loaded into memory and copied onto the new object. Default is True.

  • data (array_like, optional) – Data to use in the new object. Must have same shape as original. When data is used, deep is ignored.

Returns:

object (NamedArray) – New object with dimensions, attributes, and optionally data copied from original.