pandas.NumericIndex

class pandas.NumericIndex(data=None, dtype=None, copy=False, name=None)[source]

Immutable sequence used for indexing and alignment. The basic object storing axis labels for all pandas objects. NumericIndex is a special case of Index with purely numpy int/uint/float labels.

New in version 1.4.0.

Parameters
dataarray-like (1-dimensional)
dtypeNumPy dtype (default: None)
copybool

Make a copy of input ndarray.

nameobject

Name to be stored in the index.

See also

Index

The base pandas Index type.

Int64Index

Index of purely int64 labels (deprecated).

UInt64Index

Index of purely uint64 labels (deprecated).

Float64Index

Index of purely float64 labels (deprecated).

Notes

An NumericIndex instance can only contain numpy int64/32/16/8, uint64/32/16/8 or float64/32/16 dtype. In particular, NumericIndex can not hold Pandas numeric dtypes (Int64Dtype, Int32Dtype etc.).

Examples

>>> pd.NumericIndex([1, 2, 3], dtype="int8")
NumericIndex([1, 2, 3], dtype='int8')
>>> pd.NumericIndex([1, 2, 3], dtype="float32")
NumericIndex([1.0, 2.0, 3.0], dtype='float32')

Attributes

None

Methods

None