# xarray.DataArray.str.capitalize

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

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('df428d3a-46ab-4f60-9220-824013583a70','4b4ccaa9-a717-4293-96a6-a5b031381bb8','b7307543-7473-44e2-b5c9-3f602ee42c80','../lite/tree/../notebooks/index.html?path=73321067_3725_4da0_97bf_04d3e67c2e18.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="b7307543-7473-44e2-b5c9-3f602ee42c80" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('df428d3a-46ab-4f60-9220-824013583a70','b7307543-7473-44e2-b5c9-3f602ee42c80')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('df428d3a-46ab-4f60-9220-824013583a70','b7307543-7473-44e2-b5c9-3f602ee42c80')">Open In Tab</button></div><div id="4b4ccaa9-a717-4293-96a6-a5b031381bb8" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
