Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K

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.

Examples

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

For an index:

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

[8]ページ先頭

©2009-2025 Movatter.jp