# 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('d2c2db26-c85f-4cc2-9b5b-32e8e8837007','c8408365-77c1-422b-968f-f4336bbbe5e4','fa6097f8-aeb1-4e7d-b0cf-650008e79edc','../lite/tree/../notebooks/index.html?path=8bb1d083_94c4_4368_8c9d_3e64ada82343.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="fa6097f8-aeb1-4e7d-b0cf-650008e79edc" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('d2c2db26-c85f-4cc2-9b5b-32e8e8837007','fa6097f8-aeb1-4e7d-b0cf-650008e79edc')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('d2c2db26-c85f-4cc2-9b5b-32e8e8837007','fa6097f8-aeb1-4e7d-b0cf-650008e79edc')">Open In Tab</button></div><div id="c8408365-77c1-422b-968f-f4336bbbe5e4" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
