# xarray.Variable.copy

#### Variable.copy(deep=True, data=None)[[source]](https://github.com/pydata/xarray/blob/main/xarray/namedarray/core.py#L494-L524)

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`](https://docs.python.org/3/builtins/functions.html#bool), *default*: [`True`](https://docs.python.org/3/builtins/constants.html#True)) – Whether the data array is loaded into memory and copied onto
    the new object. Default is True.
  * **data** ([array_like](https://numpy.org/doc/stable/glossary.html#term-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.
