Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion content/xarray.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ Xarray allows you to select data using the ``.sel()`` method, which uses the lab

>>> ds['Temperature_isobaric'].sel(x='-3292.0078')

By default, you need to enter the exact coordinate, but often we want to select the closest value to some number. For this, you can use ``method='nearest'``: ::

>>> ds['Temperature_isobaric'].sel(x='-3292', method='nearest')

Output: ::

<xarray.DataArray 'Temperature_isobaric' (time1: 1, isobaric1: 29, y: 119)> Size: 14kB
Expand Down Expand Up @@ -187,7 +191,7 @@ Output: ::
Grib1_Level_Desc: Isobaric surface


We can still access the same data by index using the ``.isel()`` method: ::
We can also access the same data by index using the ``.isel()`` method: ::

>>> ds['Temperature_isobaric'].isel(x=1)

Expand Down
Loading