A RetroSearch Logo

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

Search Query:

Showing content from https://pandas.pydata.org/docs/dev/development/../reference/api/pandas.Index.item.html below:

pandas.Index.item — pandas 3.0.0.dev0+2320.g2547ff324a documentation

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

Return the first element of the underlying data as a Python scalar.

Returns:
scalar

The first element of Series or Index.

Raises:
ValueError

If the data is not length = 1.

See also

Index.values

Returns an array representing the data in the Index.

Series.head

Returns the first n rows.

Examples

>>> s = pd.Series([1])
>>> s.item()
1

For an index:

>>> s = pd.Series([1], index=["a"])
>>> s.index.item()
'a'

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