Index objects¶
Index¶
Properties¶
pd.Index.name
¶
-
pandas.Index. name Example Usage
pd.Index.names
¶
-
pandas.Index. names Important
Bodo returns a tuple instead of a FrozenList.
Example Usage
pd.Index.shape
¶
-
pandas.Index. shape
Example Usage
pd.Index.size
¶
-
pandas.Index. size Example Usage
pd.Index.empty
¶
-
pandas.Index. empty Example Usage
pd.Index.is_monotonic_increasing
¶
-
pandas.Index. andis_monotonic_increasing pandas. Index.is_monotonic Unsupported Index Types
- StringIndex
- BinaryIndex
- IntervalIndex
- CategoricalIndex
- PeriodIndex
- MultiIndex
Example Usage
pd.Index.is_monotonic_decreasing
¶
-
pandas.Index. is_monotonic_decreasing Unsupported Index Types
- StringIndex
- BinaryIndex
- IntervalIndex
- CategoricalIndex
- PeriodIndex
- MultiIndex
Example Usage
pd.Index.values
¶
-
pandas.Index. values Unsupported Index Types
- MultiIndex
- IntervalIndex
Example Usage
pd.Index.nbytes
¶
-
pandas.Index. nbytes Unsupported Index Types
- MultiIndex
- IntervalIndex
Important
Currently, Bodo upcasts all numeric index data types to 64 bitwidth.
Example Usage
pd.Index.ndim
¶
-
pandas.Index. ndim Example Usage
pd.Index.nlevels
¶
-
pandas.Index. nlevels Example Usage
#### pd.Index.dtype
-
pandas.Index. dtype Unsupported Index Types
- PeriodIndex
- IntervalIndex
Example Usage
#### pd.Index.inferred_type
-
pandas.Index. inferred_type Example Usage
#### pd.Index.is_all_dates
-
pandas.Index. is_all_dates Example Usage
#### pd.Index.T
-
pandas.Index. T Example Usage
Type information¶
pd.Index.is_numeric
¶
-
pandas.Index. is_numeric ()
Example Usage
pd.Index.is_integer
¶
-
pandas.Index. is_integer ()
Example Usage
pd.Index.is_floating
¶
-
pandas.Index. is_floating ()
Example Usage
pd.Index.is_boolean
¶
-
pandas.Index. is_boolean ()
Example Usage
pd.Index.is_categorical
¶
-
pandas.Index. is_categorical ()
Example Usage
pd.Index.is_interval
¶
-
pandas.Index. is_interval ()
Example Usage
pd.Index.is_object
¶
-
pandas.Index. is_object ()Important
Currently, Bodo diverges from the Pandas API for Indices of boolean values. Bodo always returns True, whereas Pandas returns False if the index was constructed from a pd.array of booleans.
Example Usage
Modifications and computations¶
pd.Index.copy
¶
-
pandas.Index. copy (name=None, deep=False, dtype=None, names=None)
Unsupported Index Types- MultiIndex
- IntervalIndex
Supported arguments
name
Example Usage
pd.Index.get_loc
¶
-
pandas.Index. get_loc (key, method=None, tolerance=None)Note
Should be about as fast as standard python, maybe slightly slower.
Unsupported Index Types
- CategoricalIndex
- MultiIndex
- IntervalIndex
Supported Arguments
key
: must be of same type as the index
Important
- Only works for index with unique values (scalar return).
- Only works with replicated Index
Example Usage
pd.Index.take
¶
-
pandas.Index. take (indices, axis=0, allow_fill=True, fill_value=None, **kwargs)Supported Arguments
indices
: can be boolean Array like, integer Array like, or slice
Unsupported Index Types
- MultiIndex
- IntervalIndex
Important
Bodo Does Not support
kwargs
, even for compatibility.
pd.Index.min
¶
-
pandas.Index. min (axis=None, skipna=True, args, *kwargs)Supported Arguments: None
Supported Index Types
- NumericIndex
- RangeIndex
- CategoricalIndex
- TimedeltaIndex
- DatetimeIndex
Important
- Bodo Does Not support
args
andkwargs
, even for compatibility. - For DatetimeIndex, will throw an error if all values in the index are null.
Example Usage
pd.Index.max
¶
-
pandas.Index. max (axis=None, skipna=True, args, *kwargs)Supported Arguments: None
Supported Index Types
- NumericIndex
- RangeIndex
- CategoricalIndex
- TimedeltaIndex
- DatetimeIndex
Important
- Bodo Does Not support
args
andkwargs
, even for compatibility. - For DatetimeIndex, will throw an error if all values in the index are null.
Example Usage
pd.Index.rename
¶
-
pandas.Index. rename (name, inplace=False)Supported Arguments
name
: label or list of labels
Unsupported Index Types
- MultiIndex
Example Usage
pd.Index.duplicated
¶
-
pandas.Index. duplicated (keep='first')
Supported Arguments: NoneExample Usage
pd.Index.drop_duplicates
¶
-
pandas.Index. drop_duplicates (keep='first')
Supported Arguments: NoneUnsupported Index Types
- MultiIndex
Example Usage
pd.Index.isin
¶
-
pandas.Index. isin (values)
Supported Argumentsvalues
: list-like or array-like of values
Unsupported Index Types
- MultiIndex
- IntervalIndex
- PeriodIndex
Example Usage
pd.Index.unique
¶
-
pandas.Index. unique ()
Unsupported Index Types- IntervalIndex
- PeriodIndex
- MultiIndex
Example Usage
pd.Index.nunique
¶
-
pandas.Index. nunique (dropna=True)
Supported Arguments:dropna
: can be True or False
Unsupported Index Types
- IntervalIndex
- MultiIndex
Example Usage
pd.Index.sort_values
¶
-
pandas.Index. sort_values (return_indexer=False, ascending=True, na_position="last", key=None)Supported Arguments:
ascending
: can be True or Falsena_position
: can be "first" or "last"
Unsupported Index Types
- IntervalIndex
- PeriodIndex
- MultiIndex
Example Usage
pd.Index.argsort
¶
-
pandas.Index. argsort (args, *kwargs)Supported Arguments: None
Unsupported Index Types
- IntervalIndex
- MultiIndex
Example Usage
pd.Index.all
¶
-
pandas.Index. all (args, kwargs)
***Supported Arguments**: NoneSupported Index Types
- NumericIndex (only Integers or Booleans)
- RangeIndex
- StringIndex
- BinaryIndex
!!! important Bodo diverges from the Pandas API for StringIndex and BinaryIndex by always returning a boolean instead of sometimes returning a string.
Example Usage
pd.Index.any
¶
-
pandas.Index. any (args, kwargs)
***Supported Arguments**: NoneSupported Index Types
- NumericIndex (only Integers or Booleans)
- RangeIndex
- StringIndex
- BinaryIndex
!!! important Bodo diverges from the Pandas API for StringIndex and BinaryIndex by always returning a boolean instead of sometimes returning a string.
Example Usage
pd.Index.argmax
¶
-
pandas.Index. argmax (axis=None, skipna=True, args, kwargs)
***Supported Arguments**: NoneUnsupported Index Types
- IntervalIndex
- MultiIndex
Example Usage
pd.Index.argmin
¶
-
pandas.Index. argmin (axis=None, skipna=True, args, kwargs)
***Supported Arguments**: NoneUnsupported Index Types
- IntervalIndex
- MultiIndex
Example Usage
pd.Index.where
¶
-
pandas.Index. where (cond, other=None)
Supported Arguments:cond
: can be a Series or 1-dim array of booleansother
: can be a scalar, non-categorical Series, 1-dim numpy array or StringArray with a matching type for the Index
Unsupported Index Types
- IntervalIndex
- MultiIndex
Important
Only supported for CategoricalIndex if the elements of other are the same as (or a subset of) the categories of the CategoricalIndex.
Example Usage
pd.Index.putmask
¶
-
pandas.Index. putmask (cond, other=None)
Supported Arguments:cond
: can be a Series or 1-dim array of booleansother
: can be a scalar, non-categorical Series, 1-dim numpy array or StringArray with a matching type for the Index
Unsupported Index Types
- IntervalIndex
- MultiIndex
Important
Only supported for CategoricalIndex if the elements of other are the same as (or a subset of) the categories of the CategoricalIndex.
Example Usage
pd.Index.union
¶
-
pandas.Index. union (other, sort=None)
Supported Arguments:other
: can be an Index, Series, or 1-dim numpy array with a matching type for the Index
Supported Index Types
- NumericIndex
- StringIndex
- BinaryIndex
- RangeIndex
- DatetimeIndex
- TimedeltaIndex
Important
Bodo diverges from the Pandas API for Index.union() in several ways: duplicates are removed, the order of elements may be different, the shortcuts for returning the same Index are removed, and a NumericIndex is always returned instead of a RangeIndex.
Example Usage
pd.Index.intersection
¶
-
pandas.Index. intersection (other, sort=None)
Supported Arguments:other
: can be an Index, Series, or 1-dim numpy array with a matching type for the Index
Supported Index Types
- NumericIndex
- StringIndex
- BinaryIndex
- RangeIndex
- DatetimeIndex
- TimedeltaIndex
Important
Bodo diverges from the Pandas API for Index.intersection() in several ways: the default is sort=None, and a NumericIndex is always returned instead of a RangeIndex.
Example Usage
pd.Index.difference
¶
-
pandas.Index. difference (other, sort=None)
Supported Arguments:other
: can be an Index, Series, or 1-dim numpy array with a matching type for the Index
Supported Index Types
- NumericIndex
- StringIndex
- BinaryIndex
- RangeIndex
- DatetimeIndex
- TimedeltaIndex
Important
Bodo diverges from the Pandas API for Index.difference() in several ways: the order of elements may be different and a NumericIndex is always returned instead of a RangeIndex.
Example Usage
pd.Index.symmetric_difference
¶
-
pandas.Index. symmetric_difference (other, sort=None)
Supported Arguments:other
: can be an Index, Series, or 1-dim numpy array with a matching type for the Index
Supported Index Types
- NumericIndex
- StringIndex
- BinaryIndex
- RangeIndex
- DatetimeIndex
- TimedeltaIndex
Important
Bodo diverges from the Pandas API for Index.symmetric_difference() in several ways: the order of elements may be different and a NumericIndex is always returned instead of a RangeIndex.
Example Usage
pd.Index.repeat
¶
-
pandas.Index. repeat (repeats, axis=None)
Supported Arguments:repeat
: can be a non-negative integer or array of non-negative integers
Supported Index Types
- NumericIndex
- StringIndex
- RangeIndex
- DatetimeIndex
- TimedeltaIndex
- CategoricalIndex
Important
If repeats is an integer array but its size is not the same as the length of I, undefined behavior may occur.
Example Usage
Missing values¶
pd.Index.isna
¶
-
pandas.Index. isna ()
Unsupported Index Types- MultiIndex
- IntervalIndex
Example Usage
pd.Index.isnull
¶
-
pandas.Index. isnull ()
Unsupported Index Types- MultiIndex
- IntervalIndex
Example Usage
Conversion¶
pd.Index.map
¶
-
pandas.Index. map (mapper, na_action=None)
Unsupported Index Types- MultiIndex
- IntervalIndex
Supported Arguments
mapper
: must be a function, function cannot return tuple type
Example Usage
pd.Index.to_series
¶
-
pandas.Index. to_series (index=None, name=None)
Supported Arguments:index
: can be a Index, Series, 1-dim numpy array, list, or tuplename
: can be a string or int
Unsupported Index Types
- IntervalIndex
- PeriodIndex
- MultiIndex
Example Usage
pd.Index.to_frame
¶
-
pandas.Index. to_frame (index=True, name=None)
Supported Arguments:index
: can be a True or Falsename
: can be a string or int
Unsupported Index Types
- IntervalIndex
- PeriodIndex
Example Usage
pd.Index.to_numpy
¶
-
pandas.Index. to_numpy (dtype=None, copy=True, na_value=None)
Supported Arguments:copy
: can be a True or False
Unsupported Index Types
- PeriodIndex
- MultiIndex
Important
Sometimes Bodo returns a Pandas array instead of a np.ndarray. Cases include a NumericIndex of integers containing nulls, or a CategoricalIndex.
Example Usage
pd.Index.to_list
¶
-
pandas.Index. to_list ()
Unsupported Index Types- PeriodIndex
- IntervalIndex
- MultiIndex
Example Usage
pd.Index.tolist
¶
-
pandas.Index. tolist ()
Unsupported Index Types- PeriodIndex
- IntervalIndex
- DatetimeIndex
- TimedeltaIndex
- MultiIndex
Example Usage
Numeric Index¶
Numeric index objects RangeIndex
, Int64Index
, UInt64Index
and
Float64Index
are supported as index to dataframes and series.
Constructing them in Bodo functions, passing them to Bodo functions (unboxing),
and returning them from Bodo functions (boxing) are also supported.
pd.RangeIndex
¶
-
pandas. RangeIndex (start=None, stop=None, step=None, dtype=None, copy=False, name=None)Supported Arguments
start
: integerstop
: integerstep
: integername
: String
Example Usage
pd.Int64Index
¶
pandas. Int64Index (data=None, dtype=None, copy=False, name=None)
Example Usage
pd.UInt64Index
¶
pandas. UInt64Index (data=None, dtype=None, copy=False, name=None)
Example Usage
pd.Float64Index
¶
-
pandas. Float64Index (data=None, dtype=None, copy=False, name=None)
Supported Argumentsdata
: list or arraycopy
: Booleanname
: String
Example Usage
DatetimeIndex¶
DatetimeIndex
objects are supported. They can be constructed,
boxed/unboxed, and set as index to dataframes and series.
pd.DateTimeIndex
¶
-
pandas. DatetimeIndex Supported Arguments
data
: array-like of datetime64, Integer, or strings
Date fields¶
pd.DateTimeIndex.year
¶
pandas.DatetimeIndex. year
Example Usage
pd.DateTimeIndex.month
¶
pandas.DatetimeIndex. month
Example Usage
pd.DateTimeIndex.day
¶
pandas.DatetimeIndex. day
Example Usage
pd.DateTimeIndex.hour
¶
pandas.DatetimeIndex. hour
Example Usage
pd.DateTimeIndex.minute
¶
-
pandas.DatetimeIndex. minute
Example Usage
pd.DateTimeIndex.second
¶
-
pandas.DatetimeIndex. second
Example Usage
pd.DateTimeIndex.microsecond
¶
-
pandas.DatetimeIndex. microsecond
Example Usage
pd.DateTimeIndex.nanosecond
¶
-
pandas.DatetimeIndex. nanosecond
Example Usage
pd.DateTimeIndex.date
¶
-
pandas.DatetimeIndex. date
Example Usage
pd.DateTimeIndex.dayofyear
¶
-
pandas.DatetimeIndex. dayofyear
Example Usage
pd.DateTimeIndex.day_of_year
¶
-
pandas.DatetimeIndex. day_of_year
Example Usage
pd.DateTimeIndex.dayofweek
¶
-
pandas.DatetimeIndex. dayofweek
Example Usage
pd.DateTimeIndex.day_of_week
¶
-
pandas.DatetimeIndex. day_of_week
Example Usage
pd.DateTimeIndex.is_leap_year
¶
-
pandas.DatetimeIndex. is_leap_year
Example Usage
pd.DateTimeIndex.is_month_start
¶
-
pandas.DatetimeIndex. is_month_start
Example Usage
pd.DateTimeIndex.is_month_end
¶
-
pandas.DatetimeIndex. is_month_end
Example Usage
pd.DateTimeIndex.is_quarter_start
¶
-
pandas.DatetimeIndex. is_quarter_start
Example Usage
pd.DateTimeIndex.is_quarter_end
¶
-
pandas.DatetimeIndex. is_quarter_end
Example Usage
pd.DateTimeIndex.is_year_start
¶
-
pandas.DatetimeIndex. is_year_start
Example Usage
pd.DateTimeIndex.is_year_end
¶
-
pandas.DatetimeIndex. is_year_end
Example Usage
pd.DateTimeIndex.week
¶
-
pandas.DatetimeIndex. week
Example Usage
pd.DateTimeIndex.weekday
¶
-
pandas.DatetimeIndex. weekday
Example Usage
pd.DateTimeIndex.weekofyear
¶
-
pandas.DatetimeIndex. weekofyear
Example Usage
pd.DateTimeIndex.quarter
¶
-
pandas.DatetimeIndex. quarter
Example Usage
Subtraction of Timestamp
from DatetimeIndex
and vice versa
is supported.
Comparison operators ==
, !=
, >=
, >
, <=
, <
between
DatetimeIndex
and a string of datetime
are supported.
TimedeltaIndex¶
TimedeltaIndex
objects are supported. They can be constructed,
boxed/unboxed, and set as index to dataframes and series.
pd.TimedeltaIndex
¶
-
pandas. TimedeltaIndex (data=None, unit=None, freq=NoDefault.no_default, closed=None, dtype=dtype('<m8[ns]'), copy=False, name=None)
Supported Arguments-
data
: must be array-like of timedelta64ns or Ingetger.
pd.TimedeltaIndex.days
¶
-
pandas.TimedeltaIndex. days
Example Usage
pd.TimedeltaIndex.seconds
¶
-
pandas.TimedeltaIndex. seconds
Example Usage
pd.TimedeltaIndex.microseconds
¶
-
pandas.TimedeltaIndex. microseconds
Example Usage
pd.TimedeltaIndex.nanoseconds
¶
-
pandas.TimedeltaIndex. nanoseconds
Example Usage
PeriodIndex¶
PeriodIndex
objects can be
boxed/unboxed and set as index to dataframes and series.
Operations on them will be supported in upcoming releases.
BinaryIndex¶
BinaryIndex
objects can be
boxed/unboxed and set as index to dataframes and series.
Operations on them will be supported in upcoming releases.
MultiIndex¶
pd.MultiIndex.from_product
¶
pandas. MultiIndex.from_product
(iterables and names supported as tuples, no parallel support yet)