# xarray.DataArray.str.capitalize

#### DataArray.str.capitalize()[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/accessor_str.py#L671-L696)

Convert strings in the array to be capitalized.

* **Returns:**
  **capitalized** (`same type as values`)

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('7ef92561-b5c0-45c2-9640-3dc294347419','53d9d9c3-ff0b-461f-aa3c-e141ab9b9eca','652cb7e7-4937-4d8a-8d7d-9e48cffbc583','../lite/tree/../notebooks/index.html?path=839da449_c2a8_47d4_bbe8_daea9c2f4950.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> da = xr.DataArray(
...     ["temperature", "PRESSURE", "PreCipiTation", "daily rainfall"], dims="x"
... )
>>> da
<xarray.DataArray (x: 4)> Size: 224B
array(['temperature', 'PRESSURE', 'PreCipiTation', 'daily rainfall'],
      dtype='<U14')
Dimensions without coordinates: x
>>> capitalized = da.str.capitalize()
>>> capitalized
<xarray.DataArray (x: 4)> Size: 224B
array(['Temperature', 'Pressure', 'Precipitation', 'Daily rainfall'],
      dtype='<U14')
Dimensions without coordinates: x
```

<div id="652cb7e7-4937-4d8a-8d7d-9e48cffbc583" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('7ef92561-b5c0-45c2-9640-3dc294347419','652cb7e7-4937-4d8a-8d7d-9e48cffbc583')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('7ef92561-b5c0-45c2-9640-3dc294347419','652cb7e7-4937-4d8a-8d7d-9e48cffbc583')">Open In Tab</button></div><div id="53d9d9c3-ff0b-461f-aa3c-e141ab9b9eca" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
