A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pandas.pydata.org/pandas-docs/stable/reference/api/../api/pandas.Index.to_list.html below:

pandas.Index.to_list — pandas 2.3.1 documentation

pandas.Index.to_list#
Index.to_list()[source]#

Return a list of the values.

These are each a scalar type, which is a Python scalar (for str, int, float) or a pandas scalar (for Timestamp/Timedelta/Interval/Period)

Returns:
list

See also

numpy.ndarray.tolist

Return the array as an a.ndim-levels deep nested list of Python scalars.

Examples

For Series

>>> s = pd.Series([1, 2, 3])
>>> s.to_list()
[1, 2, 3]

For Index:

>>> idx = pd.Index([1, 2, 3])
>>> idx
Index([1, 2, 3], dtype='int64')
>>> idx.to_list()
[1, 2, 3]

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4