MCPcopy
hub / github.com/pydata/xarray / isdigit

Method isdigit

xarray/core/accessor_str.py:926–948  ·  view source on GitHub ↗

Check whether all characters in each string are digits. Returns ------- isdigit : array of bool Array of boolean values with the same shape as the original array. Examples -------- >>> da = xr.DataArray(["123", "1.2", "0", "CO2",

(self)

Source from the content-addressed store, hash-verified

924 return self._apply(func=lambda x: x.isdecimal(), dtype=bool)
925
926 def isdigit(self) -> T_DataArray:
927 """
928 Check whether all characters in each string are digits.
929
930 Returns
931 -------
932 isdigit : array of bool
933 Array of boolean values with the same shape as the original array.
934
935 Examples
936 --------
937 >>> da = xr.DataArray(["123", "1.2", "0", "CO2", "NaCl"], dims="x")
938 >>> da
939 <xarray.DataArray (x: 5)> Size: 80B
940 array(['123', '1.2', '0', 'CO2', 'NaCl'], dtype='<U4')
941 Dimensions without coordinates: x
942 >>> isdigit = da.str.isdigit()
943 >>> isdigit
944 <xarray.DataArray (x: 5)> Size: 5B
945 array([ True, False, True, False, False])
946 Dimensions without coordinates: x
947 """
948 return self._apply(func=lambda x: x.isdigit(), dtype=bool)
949
950 def islower(self) -> T_DataArray:
951 """

Callers 1

test_empty_str_methodsFunction · 0.80

Calls 1

_applyMethod · 0.95

Tested by 1

test_empty_str_methodsFunction · 0.64