# xarray.DataArray.tail

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

Return a new DataArray whose data is given by the last n
values along the specified 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('aa5afe4c-7ae7-4da8-84cf-2c2c642fb65c','40413441-c654-4d47-b52c-13358cf460ae','d720d003-1377-4879-85aa-810d50e16d46','../lite/tree/../notebooks/index.html?path=3d8f09ce_8936_4d17_9e5b_8eb110ad11c6.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="d720d003-1377-4879-85aa-810d50e16d46" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('aa5afe4c-7ae7-4da8-84cf-2c2c642fb65c','d720d003-1377-4879-85aa-810d50e16d46')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('aa5afe4c-7ae7-4da8-84cf-2c2c642fb65c','d720d003-1377-4879-85aa-810d50e16d46')">Open In Tab</button></div><div id="40413441-c654-4d47-b52c-13358cf460ae" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
