Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K

pandas.Index.values#

propertyIndex.values[source]#

Return an array representing the data in the Index.

Warning

We recommend usingIndex.array orIndex.to_numpy(), depending on whether you needa reference to the underlying data or a NumPy array.

Returns:
array: numpy.ndarray or ExtensionArray

See also

Index.array

Reference to the underlying data.

Index.to_numpy

A NumPy array representing the underlying data.

Examples

Forpandas.Index:

>>>idx=pd.Index([1,2,3])>>>idxIndex([1, 2, 3], dtype='int64')>>>idx.valuesarray([1, 2, 3])

Forpandas.IntervalIndex:

>>>idx=pd.interval_range(start=0,end=5)>>>idx.values<IntervalArray>[(0, 1], (1, 2], (2, 3], (3, 4], (4, 5]]Length: 5, dtype: interval[int64, right]

[8]ページ先頭

©2009-2025 Movatter.jp