xorbits.pandas.Index#

class xorbits.pandas.Index(*args, **kwargs)[源代码]#

Immutable sequence used for indexing and alignment.

The basic object storing axis labels for all pandas objects.

在 2.0.0(pandas) 版更改: Index can hold all numpy numeric dtypes (except float16). Previously only int64/uint64/float64 dtypes were accepted.

参数
  • data (array-like (1-dimensional) (Not supported yet)) –

  • dtype (NumPy dtype (default: object) (Not supported yet)) – If dtype is None, we find the dtype that best fits the data. If an actual dtype is provided, we coerce to that dtype if it’s safe. Otherwise, an error will be raised.

  • copy (bool (Not supported yet)) – Make a copy of input ndarray.

  • name (object (Not supported yet)) – Name to be stored in the index.

  • tupleize_cols (bool (default: True) (Not supported yet)) – When True, attempt to create a MultiIndex if possible.

参见

RangeIndex

Index implementing a monotonic integer range.

CategoricalIndex

Index of Categorical s.

MultiIndex

A multi-level, or hierarchical Index.

IntervalIndex

An Index of Interval s.

DatetimeIndex

Index of datetime64 data.

TimedeltaIndex

Index of timedelta64 data.

PeriodIndex

Index of Period data.

提示

An Index instance can only contain hashable objects. An Index instance can not hold numpy float16 dtype.

实际案例

>>> pd.Index([1, 2, 3])  
Index([1, 2, 3], dtype='int64')
>>> pd.Index(list('abc'))  
Index(['a', 'b', 'c'], dtype='object')
>>> pd.Index([1, 2, 3], dtype="uint8")  
Index([1, 2, 3], dtype='uint8')

This docstring was copied from pandas.

__init__(*args, **kwargs)[源代码]#

Methods

__init__(*args, **kwargs)

Attributes

shape

data