Skip to main content
`Ctrl`+`K`

# pandas.Series.item

Series.item()

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

  This method extracts the single element from a length-1 Series or Index and returns it as a native Python scalar type (e.g., `int`, `float`, `str`).

  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'