Please note, this is a STATIC archive of website www.w3resource.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
w3resource

Pandas Series property: array

An ExtensionArray in Pandas

The ExtensionArray of the data backing Pandas Series or Index.

Syntax:

Series.array
Pandas Series array property.

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.

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

dtype array type
category

Categorical

period PeriodArray
interval IntervalArray
IntegerNA IntegerArray
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.

Example:


Download the Pandas Series Notebooks from here.

Previous: Series
Next: Series as ndarray or ndarray-like in Pandas