### Search

Enter search terms or a module, class or function name.

# pandas.Series.array¶

Series.array

The ExtensionArray of the data backing this Series or Index.

New in version 0.24.0.

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. .array differs .values which may require converting the data to a different form.

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

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

>>> pd.Series([1, 2, 3]).array
<PandasArray>
[1, 2, 3]
Length: 3, dtype: int64


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

>>> ser = pd.Series(pd.Categorical(['a', 'b', 'a']))
>>> ser.array
[a, b, a]
Categories (2, object): [a, b]

Scroll To Top
{"ft_lang_label":"__label__en","ft_lang_prob":0.52733845,"math_prob":0.7369962,"size":1418,"snap":"2019-51-2020-05","text_gpt3_token_len":352,"char_repetition_ratio":0.15275814,"word_repetition_ratio":0.05,"special_character_ratio":0.23131171,"punctuation_ratio":0.20295203,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9528314,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-12-06T21:29:03Z\",\"WARC-Record-ID\":\"<urn:uuid:1f88d860-682b-4e13-8be6-470719438151>\",\"Content-Length\":\"16989\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:e89f59a1-54a4-4dd8-9a9c-f3aa2cf823a2>\",\"WARC-Concurrent-To\":\"<urn:uuid:81dee1f4-3bc3-411f-813f-f94c778373e7>\",\"WARC-IP-Address\":\"104.26.1.204\",\"WARC-Target-URI\":\"https://pandas.pydata.org/pandas-docs/version/0.25/reference/api/pandas.Series.array.html\",\"WARC-Payload-Digest\":\"sha1:5VMDLXUDBQD3SO7TQTS2WLGMLTWPE6AB\",\"WARC-Block-Digest\":\"sha1:WCHASJOFSFRHCASWYDSTZJR3KXGACB7F\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-51/CC-MAIN-2019-51_segments_1575540490972.13_warc_CC-MAIN-20191206200121-20191206224121-00481.warc.gz\"}"}