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

Method istitle

xarray/core/accessor_str.py:1023–1053  ·  view source on GitHub ↗

Check whether all characters in each string are titlecase. Returns ------- istitle : array of bool Array of boolean values with the same shape as the original array. Examples -------- >>> da = xr.DataArray( ... [

(self)

Source from the content-addressed store, hash-verified

1021 return self._apply(func=lambda x: x.isspace(), dtype=bool)
1022
1023 def istitle(self) -> T_DataArray:
1024 """
1025 Check whether all characters in each string are titlecase.
1026
1027 Returns
1028 -------
1029 istitle : array of bool
1030 Array of boolean values with the same shape as the original array.
1031
1032 Examples
1033 --------
1034 >>> da = xr.DataArray(
1035 ... [
1036 ... "The Evolution Of Species",
1037 ... "The Theory of relativity",
1038 ... "the quantum mechanics of atoms",
1039 ... ],
1040 ... dims="title",
1041 ... )
1042 >>> da
1043 <xarray.DataArray (title: 3)> Size: 360B
1044 array(['The Evolution Of Species', 'The Theory of relativity',
1045 'the quantum mechanics of atoms'], dtype='<U30')
1046 Dimensions without coordinates: title
1047 >>> istitle = da.str.istitle()
1048 >>> istitle
1049 <xarray.DataArray (title: 3)> Size: 3B
1050 array([ True, False, False])
1051 Dimensions without coordinates: title
1052 """
1053 return self._apply(func=lambda x: x.istitle(), dtype=bool)
1054
1055 def isupper(self) -> T_DataArray:
1056 """

Callers 1

test_empty_str_methodsFunction · 0.80

Calls 1

_applyMethod · 0.95

Tested by 1

test_empty_str_methodsFunction · 0.64