MCPcopy Index your code
hub / github.com/pydata/xarray / isnumeric

Method isnumeric

xarray/core/accessor_str.py:975–997  ·  view source on GitHub ↗

Check whether all characters in each string are numeric. Returns ------- isnumeric : array of bool Array of boolean values with the same shape as the original array. Examples -------- >>> da = xr.DataArray(["123", "2.3", "H2O", "

(self)

Source from the content-addressed store, hash-verified

973 return self._apply(func=lambda x: x.islower(), dtype=bool)
974
975 def isnumeric(self) -> T_DataArray:
976 """
977 Check whether all characters in each string are numeric.
978
979 Returns
980 -------
981 isnumeric : array of bool
982 Array of boolean values with the same shape as the original array.
983
984 Examples
985 --------
986 >>> da = xr.DataArray(["123", "2.3", "H2O", "NaCl-", "Mn"], dims="x")
987 >>> da
988 <xarray.DataArray (x: 5)> Size: 100B
989 array(['123', '2.3', 'H2O', 'NaCl-', 'Mn'], dtype='<U5')
990 Dimensions without coordinates: x
991 >>> isnumeric = da.str.isnumeric()
992 >>> isnumeric
993 <xarray.DataArray (x: 5)> Size: 5B
994 array([ True, False, False, False, False])
995 Dimensions without coordinates: x
996 """
997 return self._apply(func=lambda x: x.isnumeric(), dtype=bool)
998
999 def isspace(self) -> T_DataArray:
1000 """

Callers 2

test_empty_str_methodsFunction · 0.80
test_isnumericFunction · 0.80

Calls 1

_applyMethod · 0.95

Tested by 2

test_empty_str_methodsFunction · 0.64
test_isnumericFunction · 0.64