# xarray.CFTimeIndex.putmask

#### CFTimeIndex.putmask(mask, value)[[source]](https://github.com/pydata/xarray/blob/main/xarray/../.pixi/envs/doc/lib/python3.14/site-packages/pandas/core/indexes/base.py#L5518-L5582)

Return a new Index of the values set with the mask.

* **Parameters:**
  * **mask** ([array-like](https://numpy.org/doc/stable/glossary.html#term-array_like) of [`bool`](https://docs.python.org/3/builtins/functions.html#bool)) – Array of booleans denoting where values should be replaced.
  * **value** ([scalar](../user-guide/terminology.html.md#term-scalar)) – Scalar value to use to fill holes (e.g. 0).
    This value cannot be a list-likes.
* **Returns:**
  [`Index`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Index.html#pandas.Index) – A new Index of the values set with the mask.

#### SEE ALSO
[`numpy.putmask`](https://numpy.org/doc/stable/reference/generated/numpy.putmask.html#numpy.putmask)
: Changes elements of an array based on conditional and input values.

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('78188187-a58c-4f66-85fd-9a3013a1867f','26e68ea8-daa5-40f7-856b-02f21df562ca','993e10c6-1376-4685-9070-206fe352d74a','../lite/tree/../notebooks/index.html?path=fa8a2f21_13ea_49e6_9ee8_fba84c816544.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> idx1 = pd.Index([1, 2, 3])
>>> idx2 = pd.Index([5, 6, 7])
>>> idx1.putmask([True, False, False], idx2)
Index([5, 2, 3], dtype='int64')
```

<div id="993e10c6-1376-4685-9070-206fe352d74a" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('78188187-a58c-4f66-85fd-9a3013a1867f','993e10c6-1376-4685-9070-206fe352d74a')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('78188187-a58c-4f66-85fd-9a3013a1867f','993e10c6-1376-4685-9070-206fe352d74a')">Open In Tab</button></div><div id="26e68ea8-daa5-40f7-856b-02f21df562ca" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
