# 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('cb1075a3-8ae0-4a3f-a4aa-0cbb59feb655','ccccc6a8-e1c6-44ba-90fa-df6de6f69a9f','d51a53fa-498a-4858-8df6-db15045808b7','../lite/tree/../notebooks/index.html?path=d283b3ed_fbf0_4437_b0ac_d378c0392042.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="d51a53fa-498a-4858-8df6-db15045808b7" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('cb1075a3-8ae0-4a3f-a4aa-0cbb59feb655','d51a53fa-498a-4858-8df6-db15045808b7')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('cb1075a3-8ae0-4a3f-a4aa-0cbb59feb655','d51a53fa-498a-4858-8df6-db15045808b7')">Open In Tab</button></div><div id="ccccc6a8-e1c6-44ba-90fa-df6de6f69a9f" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
