# xarray.CFTimeIndex.array

#### CFTimeIndex.array

The ExtensionArray of the data backing this Index.

This property provides direct access to the underlying array data of
an Index without requiring conversion to a NumPy array. It
returns an ExtensionArray, which is the native storage format for
pandas extension dtypes.

#### Versionchanged
Changed in version 3.1.0: The returned array is read-only, since an Index is immutable.

* **Returns:**
  `ExtensionArray` – An ExtensionArray of the values stored within. For extension
  types, this is the actual array. For NumPy native types, this
  is a thin (no copy) wrapper around [`numpy.ndarray`](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray).

  `.array` differs from `.values`, which may require converting
  the data to a different form.

#### SEE ALSO
`Index.to_numpy`
: Similar method that always returns a NumPy array.

`Series.to_numpy`
: Similar method that always returns a NumPy array.

### Notes

This table lays out the different array types for each extension
dtype within pandas.

| dtype              | array type    |
|--------------------|---------------|
| category           | Categorical   |
| period             | PeriodArray   |
| interval           | IntervalArray |
| IntegerNA          | IntegerArray  |
| string             | StringArray   |
| boolean            | BooleanArray  |
| datetime64[ns, tz] | DatetimeArray |

For any 3rd-party extension types, the array type will be an
ExtensionArray.

For all remaining dtypes `.array` will be a
`arrays.NumpyExtensionArray` wrapping the actual ndarray
stored within. If you absolutely need a NumPy array (possibly with
copying / coercing data), then use `Series.to_numpy()` instead.

### Examples

<div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesShowIframe('8b19625f-b1bb-40b4-9318-d4f3df9cd3cf','79ccc0b4-b6f8-46b1-b72d-ccd2f21f29e9','6d72bb0d-7b3b-47de-8e51-9549417f9f23','../lite/tree/../notebooks/index.html?path=1c3cf7af_8e07_417e_b2cf_e8d2f8dc8680.ipynb','None')">Try it in your browser!</button></div>

For regular NumPy types like int, and float, a NumpyExtensionArray
is returned.

```pycon
>>> pd.Index([1, 2, 3]).array
<NumpyExtensionArray>
[1, 2, 3]
Length: 3, dtype: int64
```

For extension types, like Categorical, the actual ExtensionArray
is returned

```pycon
>>> idx = pd.Index(pd.Categorical(["a", "b", "a"]))
>>> idx.array
['a', 'b', 'a']
Categories (2, str): ['a', 'b']
```

<div id="6d72bb0d-7b3b-47de-8e51-9549417f9f23" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('8b19625f-b1bb-40b4-9318-d4f3df9cd3cf','6d72bb0d-7b3b-47de-8e51-9549417f9f23')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('8b19625f-b1bb-40b4-9318-d4f3df9cd3cf','6d72bb0d-7b3b-47de-8e51-9549417f9f23')">Open In Tab</button></div><div id="79ccc0b4-b6f8-46b1-b72d-ccd2f21f29e9" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
