xorbits.pandas.Index.item#
- Index.item()#
Return the first element of the underlying data as a Python scalar.
- 返回
The first element of Series or Index.
- 返回类型
scalar
- 引发
ValueError – If the data is not length = 1.
实际案例
>>> s = pd.Series([1]) >>> s.item() 1
For an index:
>>> s = pd.Series([1], index=['a']) >>> s.index.item() 'a'
警告
This method has not been implemented yet. Xorbits will try to execute it with pandas.
This docstring was copied from pandas.core.indexes.base.Index.