# 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('88d1a103-5dc1-4b62-9bdf-6f2db10b5a55','dc1e01c3-82a9-42f9-b526-5185b108ebd7','04fa9c04-55a9-4e4e-922f-6f3bdda557d7','../lite/tree/../notebooks/index.html?path=d40cd9f4_1e67_437d_aeb5_5936b2f51f02.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="04fa9c04-55a9-4e4e-922f-6f3bdda557d7" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('88d1a103-5dc1-4b62-9bdf-6f2db10b5a55','04fa9c04-55a9-4e4e-922f-6f3bdda557d7')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('88d1a103-5dc1-4b62-9bdf-6f2db10b5a55','04fa9c04-55a9-4e4e-922f-6f3bdda557d7')">Open In Tab</button></div><div id="dc1e01c3-82a9-42f9-b526-5185b108ebd7" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
