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)>
array(['', ' ', '\t', '\n'], dtype='<U1')
Dimensions without coordinates: x
>>> isspace = da.str.isspace()
>>> isspace
<xarray.DataArray (x: 4)>
array([False,  True,  True,  True])
Dimensions without coordinates: x