๐Ÿพ Xarray is now 10 years old! ๐ŸŽ‰

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.