# 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.

* **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('e43003e0-7b18-40ab-b47f-1ec6d2101a8f','efc27c07-4a40-410c-8e18-99c0194a5126','b8db9a81-08ae-4db2-a894-6e2c7625642c','../lite/tree/../notebooks/index.html?path=a9e30f01_e9af_4ccb_ac10_1a881f222955.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="b8db9a81-08ae-4db2-a894-6e2c7625642c" class="try_examples_outer_iframe  hidden"><div class="try_examples_button_container"><button class="try_examples_button" onclick="window.tryExamplesHideIframe('e43003e0-7b18-40ab-b47f-1ec6d2101a8f','b8db9a81-08ae-4db2-a894-6e2c7625642c')">Go Back</button><button class="try_examples_button" onclick="window.openInNewTab('e43003e0-7b18-40ab-b47f-1ec6d2101a8f','b8db9a81-08ae-4db2-a894-6e2c7625642c')">Open In Tab</button></div><div id="efc27c07-4a40-410c-8e18-99c0194a5126" class="jupyterlite_sphinx_iframe_container"></div></div><script>document.addEventListener("DOMContentLoaded", function() {window.loadTryExamplesConfig("../try_examples.json");});</script>
