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

Method isalnum

xarray/core/accessor_str.py:854–876  ·  view source on GitHub ↗

Check whether all characters in each string are alphanumeric. Returns ------- isalnum : array of bool Array of boolean values with the same shape as the original array. Examples -------- >>> da = xr.DataArray(["H2O", "NaCl-"], di

(self)

Source from the content-addressed store, hash-verified

852 return self._apply(func=lambda x: normalize(form, x)) # type: ignore[arg-type]
853
854 def isalnum(self) -> T_DataArray:
855 """
856 Check whether all characters in each string are alphanumeric.
857
858 Returns
859 -------
860 isalnum : array of bool
861 Array of boolean values with the same shape as the original array.
862
863 Examples
864 --------
865 >>> da = xr.DataArray(["H2O", "NaCl-"], dims="x")
866 >>> da
867 <xarray.DataArray (x: 2)> Size: 40B
868 array(['H2O', 'NaCl-'], dtype='<U5')
869 Dimensions without coordinates: x
870 >>> isalnum = da.str.isalnum()
871 >>> isalnum
872 <xarray.DataArray (x: 2)> Size: 2B
873 array([ True, False])
874 Dimensions without coordinates: x
875 """
876 return self._apply(func=lambda x: x.isalnum(), dtype=bool)
877
878 def isalpha(self) -> T_DataArray:
879 """

Callers 2

_isalnumMUTF8Function · 0.80
test_empty_str_methodsFunction · 0.80

Calls 1

_applyMethod · 0.95

Tested by 1

test_empty_str_methodsFunction · 0.64