pyspark.pandas.Index.values#

property Index.values#

Return an array representing the data in the Index.

Warning

We recommend using Index.to_numpy() instead.

Note

This method should only be used if the resulting NumPy ndarray is expected to be small, as all the data is loaded into the driver’s memory.

Returns
numpy.ndarray

Examples

>>> ps.Series([1, 2, 3, 4]).index.values
array([0, 1, 2, 3])
>>> ps.DataFrame({'a': ['a', 'b', 'c']}, index=[[1, 2, 3], [4, 5, 6]]).index.values
array([(1, 4), (2, 5), (3, 6)], dtype=object)