# 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('0826856a-85cc-45a1-93f9-8e30b70d3880','2c12ea10-f60f-40c5-a4de-c1c0d081c8a2','9392cebd-07f5-4270-8231-ae04f157f0bf','../lite/tree/../notebooks/index.html?path=25082fde_cd22_430b_9954_052573db0aa0.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="9392cebd-07f5-4270-8231-ae04f157f0bf" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('0826856a-85cc-45a1-93f9-8e30b70d3880','9392cebd-07f5-4270-8231-ae04f157f0bf')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('0826856a-85cc-45a1-93f9-8e30b70d3880','9392cebd-07f5-4270-8231-ae04f157f0bf')">Open In Tab</button></div><div id="2c12ea10-f60f-40c5-a4de-c1c0d081c8a2" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
