# 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('52668afa-5ba1-4b61-9f15-e81c3fab9bad','68a030a0-0e93-488a-b077-f0fcb38f855e','e08d0604-c67b-41f5-a96f-25c9b135ac05','../lite/tree/../notebooks/index.html?path=a44d7dd5_ce83_4198_90ed_4b57deb94912.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="e08d0604-c67b-41f5-a96f-25c9b135ac05" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('52668afa-5ba1-4b61-9f15-e81c3fab9bad','e08d0604-c67b-41f5-a96f-25c9b135ac05')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('52668afa-5ba1-4b61-9f15-e81c3fab9bad','e08d0604-c67b-41f5-a96f-25c9b135ac05')">Open In Tab</button></div><div id="68a030a0-0e93-488a-b077-f0fcb38f855e" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
