# xarray.CFTimeIndex.take

#### CFTimeIndex.take(indices, axis=0, allow_fill=True, fill_value=None, \*\*kwargs)[[source]](https://github.com/pydata/xarray/blob/main/xarray/../.pixi/envs/doc/lib/python3.14/site-packages/pandas/core/indexes/base.py#L1228-L1303)

Return a new Index of the values selected by the indices.

For internal compatibility with numpy arrays.

* **Parameters:**
  * **indices** ([array-like](https://numpy.org/doc/stable/glossary.html#term-array_like)) – Indices to be taken.
  * **axis** (`{0 or 'index'}`, *optional*) – The axis over which to select values, always 0 or ‘index’.
  * **allow_fill** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool), *default* [`True`](https://docs.python.org/3/builtins/constants.html#True)) – How to handle negative values in indices.
    * False: negative values in indices indicate positional indices
      from the right (the default). This is similar to
      [`numpy.take()`](https://numpy.org/doc/stable/reference/generated/numpy.take.html#numpy.take).
    * True: negative values in indices indicate
      missing values. These values are set to fill_value. Any
      other negative values raise a `ValueError`.
  * **fill_value** ([scalar](../user-guide/terminology.html.md#term-scalar), *default* [`None`](https://docs.python.org/3/builtins/constants.html#None)) – If allow_fill=True and fill_value is not None, indices specified by
    -1 are regarded as NA. If Index doesn’t hold NA, raise ValueError.
  * **\*\*kwargs** – Required for compatibility with numpy.
* **Returns:**
  [`Index`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Index.html#pandas.Index) – An index formed of elements at the given indices. Will be the same
  type as self, except for RangeIndex.

#### SEE ALSO
[`numpy.ndarray.take`](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.take.html#numpy.ndarray.take)
: Return an array formed from the elements of a at the given indices.

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('0d8c91f5-5b78-4d29-9d75-37b3e4729129','3bd4f58a-c5d9-4ab5-a91b-f2a64b382cbf','3a687216-c80c-464c-8d15-e0f3b053fd38','../lite/tree/../notebooks/index.html?path=623e8129_2b37_4647_9bdc_87fe2553ccae.ipynb','None')">Try it in your browser!</button></div>
```pycon
>>> idx = pd.Index(["a", "b", "c"])
>>> idx.take([2, 2, 1, 2])
Index(['c', 'c', 'b', 'c'], dtype='str')
```

<div id="3a687216-c80c-464c-8d15-e0f3b053fd38" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('0d8c91f5-5b78-4d29-9d75-37b3e4729129','3a687216-c80c-464c-8d15-e0f3b053fd38')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('0d8c91f5-5b78-4d29-9d75-37b3e4729129','3a687216-c80c-464c-8d15-e0f3b053fd38')">Open In Tab</button></div><div id="3bd4f58a-c5d9-4ab5-a91b-f2a64b382cbf" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
