# xarray.DataArray.str.isdigit

#### DataArray.str.isdigit()[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/accessor_str.py#L951-L974)

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('d2333aa0-1e7d-4989-a4a1-9de47fa68f0e','5aefb19b-3f12-4cd0-8a26-3bd3ed2e1fb9','4675d4a3-c161-4dc7-9464-ee82bebec784','../lite/tree/../notebooks/index.html?path=ba055716_ffb5_4dca_9a29_e5f4a9f5689b.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="4675d4a3-c161-4dc7-9464-ee82bebec784" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('d2333aa0-1e7d-4989-a4a1-9de47fa68f0e','4675d4a3-c161-4dc7-9464-ee82bebec784')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('d2333aa0-1e7d-4989-a4a1-9de47fa68f0e','4675d4a3-c161-4dc7-9464-ee82bebec784')">Open In Tab</button></div><div id="5aefb19b-3f12-4cd0-8a26-3bd3ed2e1fb9" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
