🍾 Xarray is now 10 years old! 🎉

xarray.DataArray.str.isspace

xarray.DataArray.str.isspace#

DataArray.str.isspace()[source]#

Check whether all characters in each string are spaces.

Returns:

isspace (array of bool) – Array of boolean values with the same shape as the original array.

Examples

>>> da = xr.DataArray(["", " ", "\t", "\n"], dims="x")
>>> da
<xarray.DataArray (x: 4)> Size: 16B
array(['', ' ', '\t', '\n'], dtype='<U1')
Dimensions without coordinates: x
>>> isspace = da.str.isspace()
>>> isspace
<xarray.DataArray (x: 4)> Size: 4B
array([False,  True,  True,  True])
Dimensions without coordinates: x