xarray.core.accessor_str.StringAccessor.isdecimal

xarray.core.accessor_str.StringAccessor.isdecimal#

StringAccessor.isdecimal()[source]#

Check whether all characters in each string are decimal.

Returns:

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

Examples

>>> da = xr.DataArray(["2.3", "123", "0"], dims="x")
>>> da
<xarray.DataArray (x: 3)> Size: 36B
array(['2.3', '123', '0'], dtype='<U3')
Dimensions without coordinates: x
>>> isdecimal = da.str.isdecimal()
>>> isdecimal
<xarray.DataArray (x: 3)> Size: 3B
array([False,  True,  True])
Dimensions without coordinates: x