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)
| 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 | """ |