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

Method title

xarray/core/accessor_str.py:745–766  ·  view source on GitHub ↗

Convert strings in the array to titlecase. Returns ------- titled : same type as values Examples -------- >>> da = xr.DataArray(["temperature", "PRESSURE", "HuMiDiTy"], dims="x") >>> da Size: 132B

(self)

Source from the content-addressed store, hash-verified

743 return self._apply(func=lambda x: x.swapcase())
744
745 def title(self) -> T_DataArray:
746 """
747 Convert strings in the array to titlecase.
748
749 Returns
750 -------
751 titled : same type as values
752
753 Examples
754 --------
755 >>> da = xr.DataArray(["temperature", "PRESSURE", "HuMiDiTy"], dims="x")
756 >>> da
757 <xarray.DataArray (x: 3)> Size: 132B
758 array(['temperature', 'PRESSURE', 'HuMiDiTy'], dtype='<U11')
759 Dimensions without coordinates: x
760 >>> titled = da.str.title()
761 >>> titled
762 <xarray.DataArray (x: 3)> Size: 132B
763 array(['Temperature', 'Pressure', 'Humidity'], dtype='<U11')
764 Dimensions without coordinates: x
765 """
766 return self._apply(func=lambda x: x.title())
767
768 def upper(self) -> T_DataArray:
769 """

Callers 3

test_case_bytesFunction · 0.80
test_case_strFunction · 0.80
test_empty_str_methodsFunction · 0.80

Calls 1

_applyMethod · 0.95

Tested by 3

test_case_bytesFunction · 0.64
test_case_strFunction · 0.64
test_empty_str_methodsFunction · 0.64