# xarray.core.accessor_str.StringAccessor.isdigit

#### StringAccessor.isdigit()[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/accessor_str.py#L937-L959)

Check whether all characters in each string are digits.

* **Returns:**
  **isdigit** ([array](https://numpy.org/doc/stable/glossary.html#term-array) of [`bool`](https://docs.python.org/3/builtins/functions.html#bool)) – Array of boolean values with the same shape as the original array.

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('fce517ab-6c84-4002-8a6e-9eb093ff5955','d9ec8888-3a4f-4f8a-bc4b-19717900d6a8','a23b33f9-e188-4f51-9ead-02246bac9b8c','../lite/tree/../notebooks/index.html?path=24bd3f27_e321_428e_bcc5_91d7cdb21ff8.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> da = xr.DataArray(["123", "1.2", "0", "CO2", "NaCl"], dims="x")
>>> da
<xarray.DataArray (x: 5)> Size: 80B
array(['123', '1.2', '0', 'CO2', 'NaCl'], dtype='<U4')
Dimensions without coordinates: x
>>> isdigit = da.str.isdigit()
>>> isdigit
<xarray.DataArray (x: 5)> Size: 5B
array([ True, False,  True, False, False])
Dimensions without coordinates: x
```

<div id="a23b33f9-e188-4f51-9ead-02246bac9b8c" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('fce517ab-6c84-4002-8a6e-9eb093ff5955','a23b33f9-e188-4f51-9ead-02246bac9b8c')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('fce517ab-6c84-4002-8a6e-9eb093ff5955','a23b33f9-e188-4f51-9ead-02246bac9b8c')">Open In Tab</button></div><div id="d9ec8888-3a4f-4f8a-bc4b-19717900d6a8" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
