# xarray.DataArray.tail

#### DataArray.tail(indexers=None, \*\*indexers_kwargs)[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/dataarray.py#L1899-L1945)

Return a new DataArray with the last n values along given dimension(s).

Default n = 5.

#### SEE ALSO
[`Dataset.tail`](xarray.Dataset.tail.html.md#xarray.Dataset.tail), [`DataArray.head`](xarray.DataArray.head.html.md#xarray.DataArray.head), [`DataArray.thin`](xarray.DataArray.thin.html.md#xarray.DataArray.thin)

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('d21b30d8-283e-48a0-a27d-05049bac581b','e91c4f0a-07bc-4a51-b4ed-a306b4777074','c95c1095-6535-4d49-b160-b9e8a1384b72','../lite/tree/../notebooks/index.html?path=05747474_afdb_4fe2_83a3_392c47280218.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> da = xr.DataArray(
...     np.arange(25).reshape(5, 5),
...     dims=("x", "y"),
... )
>>> da
<xarray.DataArray (x: 5, y: 5)> Size: 200B
array([[ 0,  1,  2,  3,  4],
       [ 5,  6,  7,  8,  9],
       [10, 11, 12, 13, 14],
       [15, 16, 17, 18, 19],
       [20, 21, 22, 23, 24]])
Dimensions without coordinates: x, y
```

```pycon
>>> da.tail(y=1)
<xarray.DataArray (x: 5, y: 1)> Size: 40B
array([[ 4],
       [ 9],
       [14],
       [19],
       [24]])
Dimensions without coordinates: x, y
```

```pycon
>>> da.tail({"x": 2, "y": 2})
<xarray.DataArray (x: 2, y: 2)> Size: 32B
array([[18, 19],
       [23, 24]])
Dimensions without coordinates: x, y
```

<div id="c95c1095-6535-4d49-b160-b9e8a1384b72" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('d21b30d8-283e-48a0-a27d-05049bac581b','c95c1095-6535-4d49-b160-b9e8a1384b72')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('d21b30d8-283e-48a0-a27d-05049bac581b','c95c1095-6535-4d49-b160-b9e8a1384b72')">Open In Tab</button></div><div id="e91c4f0a-07bc-4a51-b4ed-a306b4777074" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
