# xarray.DataArray

### *class* xarray.DataArray(data=<NA>, coords=None, dims=None, name=None, attrs=None, indexes=None, fastpath=False)[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/dataarray.py#L281-L7949)

N-dimensional array with labeled coordinates and dimensions.

DataArray provides a wrapper around numpy ndarrays that uses
labeled dimensions and coordinates to support metadata aware
operations. The API is similar to that for the pandas Series or
DataFrame, but DataArray objects can have any number of dimensions,
and their contents have fixed data types.

Additional features over raw numpy arrays:

- Apply operations over dimensions by name: `x.sum('time')`.
- Select or assign values by integer location (like numpy):
  `x[:10]` or by label (like pandas): `x.loc['2014-01-01']` or
  `x.sel(time='2014-01-01')`.
- Mathematical operations (e.g., `x - y`) vectorize across
  multiple dimensions (known in numpy as “broadcasting”) based on
  dimension names, regardless of their original order.
- Keep track of arbitrary metadata in the form of a Python
  dictionary: `x.attrs`
- Convert to a pandas Series: `x.to_series()`.

Getting items from or doing mathematical operations with a
DataArray always returns another DataArray.

* **Parameters:**
  * **data** ([array_like](https://numpy.org/doc/stable/glossary.html#term-array_like)) – Values for this array. Must be an `numpy.ndarray`, ndarray
    like, or castable to an `ndarray`. If a self-described xarray
    or pandas object, attempts are made to use this array’s
    metadata to fill in other unspecified arguments. A view of the
    array’s data is used instead of a copy if possible.
  * **coords** ([sequence](https://docs.python.org/3/glossary.html#term-sequence) or [`dict`](https://docs.python.org/3/builtins/stdtypes.html#dict) of [array_like](https://numpy.org/doc/stable/glossary.html#term-array_like) or [`Coordinates`](xarray.Coordinates.html.md#xarray.Coordinates), *optional*) – Coordinates (tick labels) to use for indexing along each
    dimension. The following notations are accepted:
    - mapping {dimension name: array-like}
    - sequence of tuples that are valid arguments for
      `xarray.Variable()`
      - (dims, data)
      - (dims, data, attrs)
      - (dims, data, attrs, encoding)

    Additionally, it is possible to define a coord whose name
    does not match the dimension name, or a coord based on multiple
    dimensions, with one of the following notations:
    - mapping {coord name: DataArray}
    - mapping {coord name: Variable}
    - mapping {coord name: (dimension name, array-like)}
    - mapping {coord name: (tuple of dimension names, array-like)}

    Alternatively, a [`Coordinates`](xarray.Coordinates.html.md#xarray.Coordinates) object may be used in
    order to explicitly pass indexes (e.g., a multi-index or any custom
    Xarray index) or to bypass the creation of a default index for any
    [Dimension coordinate](../user-guide/terminology.html.md#term-Dimension-coordinate) included in that object.
  * **dims** (`Hashable` or [sequence](https://docs.python.org/3/glossary.html#term-sequence) of `Hashable`, *optional*) – Name(s) of the data dimension(s). Must be either a Hashable
    (only for 1D data) or a sequence of Hashables with length equal
    to the number of dimensions. If this argument is omitted,
    dimension names are taken from `coords` (if possible) and
    otherwise default to `['dim_0', ... 'dim_n']`.
  * **name** ([`str`](xarray.DataArray.str.html.md#xarray.DataArray.str) or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – Name of this array.
  * **attrs** ([dict-like](https://docs.python.org/3/glossary.html#term-mapping) or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – Attributes to assign to the new instance. By default, an empty
    attribute dictionary is initialized.
    (see FAQ, [What is your approach to metadata?](../get-help/faq.html.md#approach-to-metadata))
  * **indexes** (`Indexes` or [dict-like](https://docs.python.org/3/glossary.html#term-mapping), *optional*) – For internal use only. For passing indexes objects to the
    new DataArray, use the `coords` argument instead with a
    `Coordinate` object (both coordinate variables
    and indexes will be extracted from the latter).

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('75d83789-4c1b-4a5f-9adb-e463ebdcfdc0','c1f9bd80-a328-4c5b-b208-f055f0cf4fcf','939eb916-6559-4db0-a9c9-acb0f34d8762','../lite/tree/../notebooks/index.html?path=d2f89822_5a9a_47ee_acec_810b5d9c2be1.ipynb','None')">Try it in your browser!</button></div>

Create data:

```pycon
>>> np.random.seed(0)
>>> temperature = 15 + 8 * np.random.randn(2, 2, 3)
>>> lon = [[-99.83, -99.32], [-99.79, -99.23]]
>>> lat = [[42.25, 42.21], [42.63, 42.59]]
>>> time = pd.date_range("2014-09-06", periods=3)
>>> reference_time = pd.Timestamp("2014-09-05")
```

Initialize a dataarray with multiple dimensions:

```pycon
>>> da = xr.DataArray(
...     data=temperature,
...     dims=["x", "y", "time"],
...     coords=dict(
...         lon=(["x", "y"], lon),
...         lat=(["x", "y"], lat),
...         time=time,
...         reference_time=reference_time,
...     ),
...     attrs=dict(
...         description="Ambient temperature.",
...         units="degC",
...     ),
... )
>>> da
<xarray.DataArray (x: 2, y: 2, time: 3)> Size: 96B
array([[[29.11241877, 18.20125767, 22.82990387],
        [32.92714559, 29.94046392,  7.18177696]],

       [[22.60070734, 13.78914233, 14.17424919],
        [18.28478802, 16.15234857, 26.63418806]]])
Coordinates:
    lon             (x, y) float64 32B -99.83 -99.32 -99.79 -99.23
    lat             (x, y) float64 32B 42.25 42.21 42.63 42.59
  * time            (time) datetime64[us] 24B 2014-09-06 2014-09-07 2014-09-08
    reference_time  datetime64[us] 8B 2014-09-05
Dimensions without coordinates: x, y
Attributes:
    description:  Ambient temperature.
    units:        degC
```

Find out where the coldest temperature was:

```pycon
>>> da.isel(da.argmin(...))
<xarray.DataArray ()> Size: 8B
array(7.18177696)
Coordinates:
    lon             float64 8B -99.32
    lat             float64 8B 42.21
    time            datetime64[us] 8B 2014-09-08
    reference_time  datetime64[us] 8B 2014-09-05
Attributes:
    description:  Ambient temperature.
    units:        degC
```

<div id="939eb916-6559-4db0-a9c9-acb0f34d8762" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('75d83789-4c1b-4a5f-9adb-e463ebdcfdc0','939eb916-6559-4db0-a9c9-acb0f34d8762')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('75d83789-4c1b-4a5f-9adb-e463ebdcfdc0','939eb916-6559-4db0-a9c9-acb0f34d8762')">Open In Tab</button></div><div id="c1f9bd80-a328-4c5b-b208-f055f0cf4fcf" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>

#### \_\_init_\_(data=<NA>, coords=None, dims=None, name=None, attrs=None, indexes=None, fastpath=False)[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/dataarray.py#L439-L501)

### Methods

| [`__init__`](#xarray.DataArray.__init__)([data, coords, dims, name, attrs, ...])                                   |                                                                                                        |
|-------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|
| [`all`](xarray.DataArray.all.html.md#xarray.DataArray.all)([dim, keep_attrs])                                        | Reduce this DataArray's data by applying `all` along some dimension(s).                                |
| [`any`](xarray.DataArray.any.html.md#xarray.DataArray.any)([dim, keep_attrs])                                        | Reduce this DataArray's data by applying `any` along some dimension(s).                                |
| [`argmax`](xarray.DataArray.argmax.html.md#xarray.DataArray.argmax)([dim, axis, keep_attrs, skipna])                    | Index or indices of the maximum of the DataArray over one or more dimensions.                          |
| [`argmin`](xarray.DataArray.argmin.html.md#xarray.DataArray.argmin)([dim, axis, keep_attrs, skipna])                    | Index or indices of the minimum of the DataArray over one or more dimensions.                          |
| [`argsort`](xarray.DataArray.argsort.html.md#xarray.DataArray.argsort)([axis, kind, order, stable, descending])          | Returns the indices that would sort this array.                                                        |
| [`as_numpy`](xarray.DataArray.as_numpy.html.md#xarray.DataArray.as_numpy)()                                               | Coerces wrapped data and coordinates into numpy arrays, returning a DataArray.                         |
| [`assign_attrs`](xarray.DataArray.assign_attrs.html.md#xarray.DataArray.assign_attrs)(\*args, \*\*kwargs)                     | Assign new attrs to this object.                                                                       |
| [`assign_coords`](xarray.DataArray.assign_coords.html.md#xarray.DataArray.assign_coords)([coords])                             | Assign new coordinates to this object.                                                                 |
| [`astype`](xarray.DataArray.astype.html.md#xarray.DataArray.astype)(dtype, \*[, order, casting, subok, ...])            | Return a copy of the xarray object, with data cast to a specified type.                                |
| [`bfill`](xarray.DataArray.bfill.html.md#xarray.DataArray.bfill)(dim[, limit])                                         | Fill NaN values by propagating values backward.                                                        |
| [`broadcast_equals`](xarray.DataArray.broadcast_equals.html.md#xarray.DataArray.broadcast_equals)(other)                          | Check whether two DataArrays are broadcast equal.                                                      |
| [`broadcast_like`](xarray.DataArray.broadcast_like.html.md#xarray.DataArray.broadcast_like)(other, \*[, exclude])               | Broadcast this DataArray against another Dataset or DataArray.                                         |
| [`chunk`](xarray.DataArray.chunk.html.md#xarray.DataArray.chunk)([chunks, name_prefix, token, lock, ...])              | Coerce this array's data into a dask array with the given chunks.                                      |
| [`clip`](xarray.DataArray.clip.html.md#xarray.DataArray.clip)([min, max, keep_attrs])                                 | Return an array whose values are limited to `[min, max]`.                                              |
| [`close`](xarray.DataArray.close.html.md#xarray.DataArray.close)()                                                     | Release any resources linked to this object.                                                           |
| [`coarsen`](xarray.DataArray.coarsen.html.md#xarray.DataArray.coarsen)([dim, boundary, side, coord_func])                | Coarsen object for DataArrays.                                                                         |
| [`combine_first`](xarray.DataArray.combine_first.html.md#xarray.DataArray.combine_first)(other)                                | Combine two DataArray objects, with union of coordinates.                                              |
| [`compute`](xarray.DataArray.compute.html.md#xarray.DataArray.compute)(\*\*kwargs)                                       | Trigger loading data into memory and return a new dataarray.                                           |
| [`conj`](xarray.DataArray.conj.html.md#xarray.DataArray.conj)()                                                       | Complex-conjugate all elements.                                                                        |
| [`conjugate`](xarray.DataArray.conjugate.html.md#xarray.DataArray.conjugate)(\*args, \*\*kwargs)                           | a.conj()                                                                                               |
| [`convert_calendar`](xarray.DataArray.convert_calendar.html.md#xarray.DataArray.convert_calendar)(calendar[, dim, align_on, ...]) | Convert the DataArray to another calendar.                                                             |
| [`copy`](xarray.DataArray.copy.html.md#xarray.DataArray.copy)([deep, data])                                           | Return a copy of this array.                                                                           |
| [`count`](xarray.DataArray.count.html.md#xarray.DataArray.count)([dim, keep_attrs])                                    | Reduce this DataArray's data by applying `count` along some dimension(s).                              |
| [`cumprod`](xarray.DataArray.cumprod.html.md#xarray.DataArray.cumprod)([dim, skipna, keep_attrs])                        | Reduce this DataArray's data by applying `cumprod` (i.e., cumulative product) along some dimension(s). |
| [`cumsum`](xarray.DataArray.cumsum.html.md#xarray.DataArray.cumsum)([dim, skipna, keep_attrs])                          | Reduce this DataArray's data by applying `cumsum` (i.e., cumulative sum) along some dimension(s).      |
| [`cumulative`](xarray.DataArray.cumulative.html.md#xarray.DataArray.cumulative)(dim[, min_periods])                         | Return an accumulating object for DataArrays.                                                          |
| `cumulative_integrate`([coord, datetime_unit])                                                                                      | Integrate cumulatively along the given coordinate using the trapezoidal rule.                          |
| [`curvefit`](xarray.DataArray.curvefit.html.md#xarray.DataArray.curvefit)(coords, func[, reduce_dims, ...])               | Curve fitting optimization for arbitrary functions.                                                    |
| [`diff`](xarray.DataArray.diff.html.md#xarray.DataArray.diff)(dim[, n, label])                                        | Calculate the n-th order discrete difference along given axis.                                         |
| [`differentiate`](xarray.DataArray.differentiate.html.md#xarray.DataArray.differentiate)(coord[, edge_order, datetime_unit])   | Differentiate the array with the second order accurate central differences.                            |
| [`dot`](xarray.DataArray.dot.html.md#xarray.DataArray.dot)(other[, dim])                                             | Perform dot product of two DataArrays along their shared dims.                                         |
| [`drop`](xarray.DataArray.drop.html.md#xarray.DataArray.drop)([labels, dim, errors])                                  | Backward compatible method based on drop_vars and drop_sel.                                            |
| [`drop_attrs`](xarray.DataArray.drop_attrs.html.md#xarray.DataArray.drop_attrs)(\*[, deep])                                 | Remove all attributes from the DataArray.                                                              |
| [`drop_duplicates`](xarray.DataArray.drop_duplicates.html.md#xarray.DataArray.drop_duplicates)(dim, \*[, keep])                  | Return a new DataArray with duplicate dimension values removed.                                        |
| [`drop_encoding`](xarray.DataArray.drop_encoding.html.md#xarray.DataArray.drop_encoding)()                                     | Return a new DataArray without encoding on the array or any coords.                                    |
| [`drop_indexes`](xarray.DataArray.drop_indexes.html.md#xarray.DataArray.drop_indexes)(coord_names, \*[, errors])              | Drop the indexes assigned to the given coordinates.                                                    |
| [`drop_isel`](xarray.DataArray.drop_isel.html.md#xarray.DataArray.drop_isel)([indexers])                                   | Drop index positions from this DataArray.                                                              |
| [`drop_sel`](xarray.DataArray.drop_sel.html.md#xarray.DataArray.drop_sel)([labels, errors])                               | Drop index labels from this DataArray.                                                                 |
| [`drop_vars`](xarray.DataArray.drop_vars.html.md#xarray.DataArray.drop_vars)(names, \*[, errors])                          | Return an array with dropped variables.                                                                |
| [`dropna`](xarray.DataArray.dropna.html.md#xarray.DataArray.dropna)(dim, \*[, how, thresh])                             | Return a new array with dropped labels for missing values along a dimension.                           |
| [`equals`](xarray.DataArray.equals.html.md#xarray.DataArray.equals)(other)                                              | Check whether two DataArrays are equal.                                                                |
| [`expand_dims`](xarray.DataArray.expand_dims.html.md#xarray.DataArray.expand_dims)([dim, axis, ...])                         | Return a new object with an additional axis (or axes) inserted.                                        |
| [`ffill`](xarray.DataArray.ffill.html.md#xarray.DataArray.ffill)(dim[, limit])                                         | Fill NaN values by propagating values forward.                                                         |
| [`fillna`](xarray.DataArray.fillna.html.md#xarray.DataArray.fillna)(value)                                              | Fill missing values in this object.                                                                    |
| [`from_dict`](xarray.DataArray.from_dict.html.md#xarray.DataArray.from_dict)(d)                                            | Convert a dictionary into an xarray.DataArray.                                                         |
| [`from_iris`](xarray.DataArray.from_iris.html.md#xarray.DataArray.from_iris)(cube)                                         | Convert an iris.cube.Cube into an xarray.DataArray.                                                    |
| [`from_series`](xarray.DataArray.from_series.html.md#xarray.DataArray.from_series)(series[, sparse])                         | Convert a pandas.Series into an xarray.DataArray.                                                      |
| [`get_axis_num`](xarray.DataArray.get_axis_num.html.md#xarray.DataArray.get_axis_num)(dim)                                    | Return axis number(s) corresponding to dimension(s) in this array.                                     |
| [`get_index`](xarray.DataArray.get_index.html.md#xarray.DataArray.get_index)(key)                                          | Get an index for a dimension, with fall-back to a default RangeIndex.                                  |
| [`groupby`](xarray.DataArray.groupby.html.md#xarray.DataArray.groupby)([group, squeeze, ...])                            | Return a DataArrayGroupBy object for performing grouped operations.                                    |
| [`groupby_bins`](xarray.DataArray.groupby_bins.html.md#xarray.DataArray.groupby_bins)(group, bins, \*[, right, ...])          | Return a DataArrayGroupBy object for performing grouped operations.                                    |
| [`head`](xarray.DataArray.head.html.md#xarray.DataArray.head)([indexers])                                             | Return a new DataArray with the first n values along given dimension(s).                               |
| [`identical`](xarray.DataArray.identical.html.md#xarray.DataArray.identical)(other)                                        | Check whether two DataArrays are identical.                                                            |
| [`idxmax`](xarray.DataArray.idxmax.html.md#xarray.DataArray.idxmax)([dim, skipna, fill_value, keep_attrs])              | Return the coordinate label of the maximum value along one or more dimensions.                         |
| [`idxmin`](xarray.DataArray.idxmin.html.md#xarray.DataArray.idxmin)([dim, skipna, fill_value, keep_attrs])              | Return the coordinate label of the minimum value along one or more dimensions.                         |
| [`integrate`](xarray.DataArray.integrate.html.md#xarray.DataArray.integrate)([coord, datetime_unit])                       | Integrate along the given coordinate using the trapezoidal rule.                                       |
| [`interp`](xarray.DataArray.interp.html.md#xarray.DataArray.interp)([coords, method, assume_sorted, kwargs])            | Interpolate a DataArray onto new coordinates.                                                          |
| [`interp_calendar`](xarray.DataArray.interp_calendar.html.md#xarray.DataArray.interp_calendar)(target[, dim])                    | Interpolates the DataArray to another calendar based on decimal year measure.                          |
| [`interp_like`](xarray.DataArray.interp_like.html.md#xarray.DataArray.interp_like)(other[, method, assume_sorted, ...])      | Interpolate this object onto the coordinates of another object.                                        |
| [`interpolate_na`](xarray.DataArray.interpolate_na.html.md#xarray.DataArray.interpolate_na)([dim, method, limit, ...])          | Fill in NaNs by interpolating according to different methods.                                          |
| [`isel`](xarray.DataArray.isel.html.md#xarray.DataArray.isel)([indexers, drop, missing_dims])                         | Return a new DataArray selecting indexes along the specified dimension(s).                             |
| [`isin`](xarray.DataArray.isin.html.md#xarray.DataArray.isin)(test_elements)                                          | Test each value in the array for whether it is in test elements.                                       |
| [`isnull`](xarray.DataArray.isnull.html.md#xarray.DataArray.isnull)([keep_attrs])                                       | Test each value in the array for whether it is a missing value.                                        |
| [`item`](xarray.DataArray.item.html.md#xarray.DataArray.item)(\*args)                                                 | Copy an element of an array to a standard Python scalar and return it.                                 |
| [`load`](xarray.DataArray.load.html.md#xarray.DataArray.load)(\*\*kwargs)                                             | Trigger loading data into memory and return this dataarray.                                            |
| [`load_async`](xarray.DataArray.load_async.html.md#xarray.DataArray.load_async)(\*\*kwargs)                                 | Trigger and await asynchronous loading of data into memory and return this dataarray.                  |
| [`map_blocks`](xarray.DataArray.map_blocks.html.md#xarray.DataArray.map_blocks)(func[, args, kwargs, template])             | Apply a function to each block of this DataArray.                                                      |
| [`max`](xarray.DataArray.max.html.md#xarray.DataArray.max)([dim, skipna, keep_attrs])                                | Reduce this DataArray's data by applying `max` (i.e., maximum) along some dimension(s).                |
| [`mean`](xarray.DataArray.mean.html.md#xarray.DataArray.mean)([dim, skipna, keep_attrs])                              | Reduce this DataArray's data by applying `mean` along some dimension(s).                               |
| [`median`](xarray.DataArray.median.html.md#xarray.DataArray.median)([dim, skipna, keep_attrs])                          | Reduce this DataArray's data by applying `median` along some dimension(s).                             |
| [`min`](xarray.DataArray.min.html.md#xarray.DataArray.min)([dim, skipna, keep_attrs])                                | Reduce this DataArray's data by applying `min` (i.e., minimum) along some dimension(s).                |
| [`notnull`](xarray.DataArray.notnull.html.md#xarray.DataArray.notnull)([keep_attrs])                                     | Test each value in the array for whether it is not a missing value.                                    |
| [`pad`](xarray.DataArray.pad.html.md#xarray.DataArray.pad)([pad_width, mode, stat_length, ...])                      | Pad this array along one or more dimensions.                                                           |
| [`persist`](xarray.DataArray.persist.html.md#xarray.DataArray.persist)(\*\*kwargs)                                       | Trigger computation in constituent dask arrays.                                                        |
| [`pipe`](xarray.DataArray.pipe.html.md#xarray.DataArray.pipe)(func, \*args, \*\*kwargs)                               | Apply `func(self, *args, **kwargs)`.                                                                   |
| [`polyfit`](xarray.DataArray.polyfit.html.md#xarray.DataArray.polyfit)(dim, deg[, skipna, rcond, w, full, cov])          | Least squares polynomial fit.                                                                          |
| [`prod`](xarray.DataArray.prod.html.md#xarray.DataArray.prod)([dim, skipna, min_count, keep_attrs])                   | Reduce this DataArray's data by applying `prod` (i.e., product) along some dimension(s).               |
| [`quantile`](xarray.DataArray.quantile.html.md#xarray.DataArray.quantile)(q[, dim, method, keep_attrs, skipna])           | Compute the qth quantile of the data along the specified dimension.                                    |
| [`query`](xarray.DataArray.query.html.md#xarray.DataArray.query)([queries, parser, engine, missing_dims])              | Return a new data array indexed along the specified dimension(s).                                      |
| [`rank`](xarray.DataArray.rank.html.md#xarray.DataArray.rank)(dim, \*[, pct, keep_attrs])                             | Ranks the data.                                                                                        |
| [`reduce`](xarray.DataArray.reduce.html.md#xarray.DataArray.reduce)(func[, dim, axis, keep_attrs, keepdims])            | Reduce this array by applying func along some dimension(s).                                            |
| [`reindex`](xarray.DataArray.reindex.html.md#xarray.DataArray.reindex)([indexers, method, tolerance, copy, ...])         | Conform this object onto a new set of indexes.                                                         |
| [`reindex_like`](xarray.DataArray.reindex_like.html.md#xarray.DataArray.reindex_like)(other, \*[, method, tolerance, ...])    | Conform this object onto the indexes of another object.                                                |
| [`rename`](xarray.DataArray.rename.html.md#xarray.DataArray.rename)([new_name_or_name_dict])                            | Return a DataArray with renamed coordinates, dimensions or a new name.                                 |
| [`reorder_levels`](xarray.DataArray.reorder_levels.html.md#xarray.DataArray.reorder_levels)([dim_order])                        | Rearrange index levels using input order.                                                              |
| [`resample`](xarray.DataArray.resample.html.md#xarray.DataArray.resample)([indexer, skipna, closed, label, ...])          | Return a Resample object for performing resampling operations.                                         |
| [`reset_coords`](xarray.DataArray.reset_coords.html.md#xarray.DataArray.reset_coords)([names, drop])                          | Given names of coordinates, reset them to become variables.                                            |
| `reset_encoding`()                                                                                                                  |                                                                                                        |
| [`reset_index`](xarray.DataArray.reset_index.html.md#xarray.DataArray.reset_index)(dims_or_levels[, drop])                   | Reset the specified index(es) or multi-index level(s).                                                 |
| [`roll`](xarray.DataArray.roll.html.md#xarray.DataArray.roll)([shifts, roll_coords])                                  | Roll this array by an offset along one or more dimensions.                                             |
| [`rolling`](xarray.DataArray.rolling.html.md#xarray.DataArray.rolling)([dim, min_periods, center])                       | Return a rolling window object for DataArrays.                                                         |
| [`rolling_exp`](xarray.DataArray.rolling_exp.html.md#xarray.DataArray.rolling_exp)([window, window_type])                    | Exponentially-weighted moving window.                                                                  |
| [`round`](xarray.DataArray.round.html.md#xarray.DataArray.round)(\*args, \*\*kwargs)                                   |                                                                                                        |
| [`searchsorted`](xarray.DataArray.searchsorted.html.md#xarray.DataArray.searchsorted)(v[, side, sorter])                      | Find indices where elements of v should be inserted in a to maintain order.                            |
| [`sel`](xarray.DataArray.sel.html.md#xarray.DataArray.sel)([indexers, method, tolerance, drop])                      | Return a new DataArray selecting index labels along the given dimension(s).                            |
| `set_close`(close)                                                                                                                  | Register the function that releases any resources linked to this object.                               |
| [`set_index`](xarray.DataArray.set_index.html.md#xarray.DataArray.set_index)([indexes, append])                            | Set DataArray (multi-)indexes using one or more existing coordinates.                                  |
| [`set_xindex`](xarray.DataArray.set_xindex.html.md#xarray.DataArray.set_xindex)(coord_names[, index_cls])                   | Set a new, Xarray-compatible index from one or more existing coordinate(s).                            |
| [`shift`](xarray.DataArray.shift.html.md#xarray.DataArray.shift)([shifts, fill_value])                                 | Shift this DataArray by an offset along one or more dimensions.                                        |
| [`sortby`](xarray.DataArray.sortby.html.md#xarray.DataArray.sortby)(variables[, ascending])                             | Sort object by labels or values (along an axis).                                                       |
| [`squeeze`](xarray.DataArray.squeeze.html.md#xarray.DataArray.squeeze)([dim, drop, axis])                                | Return a new object with squeezed data.                                                                |
| [`stack`](xarray.DataArray.stack.html.md#xarray.DataArray.stack)([dim, create_index, index_cls])                       | Stack any number of existing dimensions into a single new dimension.                                   |
| [`std`](xarray.DataArray.std.html.md#xarray.DataArray.std)([dim, skipna, ddof, keep_attrs])                          | Reduce this DataArray's data by applying `std` (i.e., standard deviation) along some dimension(s).     |
| [`sum`](xarray.DataArray.sum.html.md#xarray.DataArray.sum)([dim, skipna, min_count, keep_attrs])                     | Reduce this DataArray's data by applying `sum` along some dimension(s).                                |
| [`swap_dims`](xarray.DataArray.swap_dims.html.md#xarray.DataArray.swap_dims)([dims_dict])                                  | Return a new DataArray with swapped dimensions.                                                        |
| [`tail`](xarray.DataArray.tail.html.md#xarray.DataArray.tail)([indexers])                                             | Return a new DataArray with the last n values along given dimension(s).                                |
| [`thin`](xarray.DataArray.thin.html.md#xarray.DataArray.thin)([indexers])                                             | Return a new DataArray with each n-th value along the given dimension(s).                              |
| [`to_dask_dataframe`](xarray.DataArray.to_dask_dataframe.html.md#xarray.DataArray.to_dask_dataframe)([dim_order, set_index])       | Convert this array into a dask.dataframe.DataFrame.                                                    |
| [`to_dataframe`](xarray.DataArray.to_dataframe.html.md#xarray.DataArray.to_dataframe)([name, dim_order])                      | Convert this array and its coordinates into a tidy pandas.DataFrame.                                   |
| [`to_dataset`](xarray.DataArray.to_dataset.html.md#xarray.DataArray.to_dataset)([dim, name, promote_attrs])                 | Convert a DataArray to a Dataset.                                                                      |
| [`to_dict`](xarray.DataArray.to_dict.html.md#xarray.DataArray.to_dict)([data, encoding])                                 | Convert this xarray.DataArray into a dictionary.                                                       |
| [`to_index`](xarray.DataArray.to_index.html.md#xarray.DataArray.to_index)()                                               | Convert this variable to a pandas.Index.                                                               |
| [`to_iris`](xarray.DataArray.to_iris.html.md#xarray.DataArray.to_iris)()                                                 | Convert this array into an iris.cube.Cube.                                                             |
| [`to_masked_array`](xarray.DataArray.to_masked_array.html.md#xarray.DataArray.to_masked_array)([copy])                           | Convert this array into a numpy.ma.MaskedArray.                                                        |
| [`to_netcdf`](xarray.DataArray.to_netcdf.html.md#xarray.DataArray.to_netcdf)([path, mode, format, group, ...])             | Write DataArray contents to a netCDF file.                                                             |
| [`to_numpy`](xarray.DataArray.to_numpy.html.md#xarray.DataArray.to_numpy)()                                               | Coerces wrapped data to numpy and returns a numpy.ndarray.                                             |
| [`to_pandas`](xarray.DataArray.to_pandas.html.md#xarray.DataArray.to_pandas)()                                             | Convert this array into a pandas object with the same shape.                                           |
| [`to_series`](xarray.DataArray.to_series.html.md#xarray.DataArray.to_series)()                                             | Convert this array into a pandas.Series.                                                               |
| [`to_unstacked_dataset`](xarray.DataArray.to_unstacked_dataset.html.md#xarray.DataArray.to_unstacked_dataset)(dim[, level])           | Unstack DataArray to a Dataset along a level of a stacked coordinate.                                  |
| [`to_zarr`](xarray.DataArray.to_zarr.html.md#xarray.DataArray.to_zarr)([store, mode, group, encoding, ...])              | Write DataArray contents to a Zarr store.                                                              |
| [`transpose`](xarray.DataArray.transpose.html.md#xarray.DataArray.transpose)(\*dim[, transpose_coords, missing_dims])      | Return a new DataArray object with transposed dimensions.                                              |
| [`unify_chunks`](xarray.DataArray.unify_chunks.html.md#xarray.DataArray.unify_chunks)()                                       | Unify chunk size along all chunked dimensions of this DataArray.                                       |
| [`unstack`](xarray.DataArray.unstack.html.md#xarray.DataArray.unstack)([dim, fill_value, sparse])                        | Unstack existing dimensions corresponding to MultiIndexes.                                             |
| [`var`](xarray.DataArray.var.html.md#xarray.DataArray.var)([dim, skipna, ddof, keep_attrs])                          | Reduce this DataArray's data by applying `var` (i.e., variance) along some dimension(s).               |
| [`weighted`](xarray.DataArray.weighted.html.md#xarray.DataArray.weighted)(weights)                                        | Weighted DataArray operations.                                                                         |
| [`where`](xarray.DataArray.where.html.md#xarray.DataArray.where)(cond[, other, drop])                                  | Filter elements from this object according to a condition.                                             |

### Attributes

| [`T`](xarray.DataArray.T.html.md#xarray.DataArray.T)                   |                                                                                                                                                                              |
|-----------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [`attrs`](xarray.DataArray.attrs.html.md#xarray.DataArray.attrs)           | Dictionary storing arbitrary metadata with this array.                                                                                                                       |
| [`chunks`](xarray.DataArray.chunks.html.md#xarray.DataArray.chunks)         | Tuple of block lengths for this dataarray's data, in order of dimensions.                                                                                                    |
| [`chunksizes`](xarray.DataArray.chunksizes.html.md#xarray.DataArray.chunksizes) | Mapping from dimension names to block lengths for this dataarray's data.                                                                                                     |
| [`coords`](xarray.DataArray.coords.html.md#xarray.DataArray.coords)         | Mapping of [`DataArray`](#xarray.DataArray) objects for coordinates.                                                                               |
| [`data`](xarray.DataArray.data.html.md#xarray.DataArray.data)             | The DataArray's data as an array.                                                                                                                                            |
| [`dims`](xarray.DataArray.dims.html.md#xarray.DataArray.dims)             | Tuple of dimension names associated with this array.                                                                                                                         |
| `dt`                                                                                    | alias of `CombinedDatetimelikeAccessor`[[`DataArray`](#xarray.DataArray)]                                                                          |
| [`dtype`](xarray.DataArray.dtype.html.md#xarray.DataArray.dtype)           | Data-type of the array’s elements.                                                                                                                                           |
| [`encoding`](xarray.DataArray.encoding.html.md#xarray.DataArray.encoding)     | Dictionary of format-specific settings for serializing this array.                                                                                                           |
| [`imag`](xarray.DataArray.imag.html.md#xarray.DataArray.imag)             | The imaginary part of the array.                                                                                                                                             |
| [`indexes`](xarray.DataArray.indexes.html.md#xarray.DataArray.indexes)       | Mapping of pandas.Index objects used for label based indexing.                                                                                                               |
| [`loc`](xarray.DataArray.loc.html.md#xarray.DataArray.loc)               | Attribute for location based indexing like pandas.                                                                                                                           |
| [`name`](xarray.DataArray.name.html.md#xarray.DataArray.name)             | The name of this array.                                                                                                                                                      |
| [`nbytes`](xarray.DataArray.nbytes.html.md#xarray.DataArray.nbytes)         | Total bytes consumed by the elements of this DataArray's data.                                                                                                               |
| [`ndim`](xarray.DataArray.ndim.html.md#xarray.DataArray.ndim)             | Number of array dimensions.                                                                                                                                                  |
| [`real`](xarray.DataArray.real.html.md#xarray.DataArray.real)             | The real part of the array.                                                                                                                                                  |
| [`shape`](xarray.DataArray.shape.html.md#xarray.DataArray.shape)           | Tuple of array dimensions.                                                                                                                                                   |
| [`size`](xarray.DataArray.size.html.md#xarray.DataArray.size)             | Number of elements in the array.                                                                                                                                             |
| [`sizes`](xarray.DataArray.sizes.html.md#xarray.DataArray.sizes)           | Ordered mapping from dimension names to lengths.                                                                                                                             |
| [`str`](xarray.DataArray.str.html.md#xarray.DataArray.str)               | alias of [`StringAccessor`](xarray.core.accessor_str.StringAccessor.html.md#xarray.core.accessor_str.StringAccessor)[[`DataArray`](#xarray.DataArray)] |
| [`values`](xarray.DataArray.values.html.md#xarray.DataArray.values)         | The array's data converted to numpy.ndarray.                                                                                                                                 |
| [`variable`](xarray.DataArray.variable.html.md#xarray.DataArray.variable)     | Low level interface to the Variable object for this DataArray.                                                                                                               |
| [`xindexes`](xarray.DataArray.xindexes.html.md#xarray.DataArray.xindexes)     | Mapping of `Index` objects for label indexing.                                                                                                                               |
