Many of these methods or variants thereof are available on the objects that contain an index (Series/DataFrame) and those should most likely be used before calling these methods directly.
Index
Immutable ndarray implementing an ordered, sliceable set.
Index.values
Return an array representing the data in the Index.
Index.is_monotonic
Alias for is_monotonic_increasing.
Index.is_monotonic_increasing
Return if the index is monotonic increasing (only equal or increasing) values.
Index.is_monotonic_decreasing
Return if the index is monotonic decreasing (only equal or decreasing) values.
Index.is_unique
Return if the index has unique values.
Index.has_duplicates
Index.hasnans
Return if I have any nans; enables various perf speedups.
Index.dtype
Return the dtype object of the underlying data.
Index.inferred_type
Return a string of the type inferred from the values.
Index.is_all_dates
Index.shape
Return a tuple of the shape of the underlying data.
Index.name
Index.names
Index.nbytes
Return the number of bytes in the underlying data.
Index.ndim
Number of dimensions of the underlying data, by definition 1.
Index.size
Return the number of elements in the underlying data.
Index.empty
Index.T
Return the transpose, which is by definition self.
Index.memory_usage(self[, deep])
Index.memory_usage
Memory usage of the values.
Index.all(self, \*args, \*\*kwargs)
Index.all
Return whether all elements are True.
Index.any(self, \*args, \*\*kwargs)
Index.any
Return whether any element is True.
Index.argmin(self[, axis, skipna])
Index.argmin
Return a ndarray of the minimum argument indexer.
Index.argmax(self[, axis, skipna])
Index.argmax
Return an ndarray of the maximum argument indexer.
Index.copy(self[, name, deep, dtype])
Index.copy
Make a copy of this object.
Index.delete(self, loc)
Index.delete
Make new Index with passed location(-s) deleted.
Index.drop(self, labels[, errors])
Index.drop
Make new Index with passed list of labels deleted.
Index.drop_duplicates(self[, keep])
Index.drop_duplicates
Return Index with duplicate values removed.
Index.duplicated(self[, keep])
Index.duplicated
Indicate duplicate index values.
Index.equals(self, other)
Index.equals
Determine if two Index objects contain the same elements.
Index.factorize(self[, sort, na_sentinel])
Index.factorize
Encode the object as an enumerated type or categorical variable.
Index.identical(self, other)
Index.identical
Similar to equals, but check that other comparable attributes are also equal.
Index.insert(self, loc, item)
Index.insert
Make new Index inserting new item at location.
Index.is_(self, other)
Index.is_
More flexible, faster check like is but that works through views.
is
Index.is_boolean(self)
Index.is_boolean
Index.is_categorical(self)
Index.is_categorical
Check if the Index holds categorical data.
Index.is_floating(self)
Index.is_floating
Index.is_integer(self)
Index.is_integer
Index.is_interval(self)
Index.is_interval
Index.is_mixed(self)
Index.is_mixed
Index.is_numeric(self)
Index.is_numeric
Index.is_object(self)
Index.is_object
Index.min(self[, axis, skipna])
Index.min
Return the minimum value of the Index.
Index.max(self[, axis, skipna])
Index.max
Return the maximum value of the Index.
Index.reindex(self, target[, method, level, …])
Index.reindex
Create index with target’s values (move/add/delete values as necessary).
Index.rename(self, name[, inplace])
Index.rename
Alter Index or MultiIndex name.
Index.repeat(self, repeats[, axis])
Index.repeat
Repeat elements of a Index.
Index.where(self, cond[, other])
Index.where
Return an Index of same shape as self and whose corresponding entries are from self where cond is True and otherwise are from other.
Index.take(self, indices[, axis, …])
Index.take
Return a new Index of the values selected by the indices.
Index.putmask(self, mask, value)
Index.putmask
Return a new Index of the values set with the mask.
Index.unique(self[, level])
Index.unique
Return unique values in the index.
Index.nunique(self[, dropna])
Index.nunique
Return number of unique elements in the object.
Index.value_counts(self[, normalize, sort, …])
Index.value_counts
Return a Series containing counts of unique values.
Index.set_names(self, names[, level, inplace])
Index.set_names
Set Index or MultiIndex name.
Index.droplevel(self[, level])
Index.droplevel
Return index with requested level(s) removed.
Index.fillna(self[, value, downcast])
Index.fillna
Fill NA/NaN values with the specified value.
Index.dropna(self[, how])
Index.dropna
Return Index without NA/NaN values.
Index.isna(self)
Index.isna
Detect missing values.
Index.notna(self)
Index.notna
Detect existing (non-missing) values.
Index.astype(self, dtype[, copy])
Index.astype
Create an Index with values cast to dtypes.
Index.item(self)
Index.item
Return the first element of the underlying data as a python scalar.
Index.map(self, mapper[, na_action])
Index.map
Map values using input correspondence (a dict, Series, or function).
Index.ravel(self[, order])
Index.ravel
Return an ndarray of the flattened values of the underlying data.
Index.to_list(self)
Index.to_list
Return a list of the values.
Index.to_native_types(self[, slicer])
Index.to_native_types
Format specified values of self and return them.
Index.to_series(self[, index, name])
Index.to_series
Create a Series with both index and values equal to the index keys.
Index.to_frame(self[, index, name])
Index.to_frame
Create a DataFrame with a column containing the Index.
Index.view(self[, cls])
Index.view
Index.argsort(self, \*args, \*\*kwargs)
Index.argsort
Return the integer indices that would sort the index.
Index.searchsorted(self, value[, side, sorter])
Index.searchsorted
Find indices where elements should be inserted to maintain order.
Index.sort_values(self[, return_indexer, …])
Index.sort_values
Return a sorted copy of the index.
Index.shift(self[, periods, freq])
Index.shift
Shift index by desired number of time frequency increments.
Index.append(self, other)
Index.append
Append a collection of Index options together.
Index.join(self, other[, how, level, …])
Index.join
Compute join_index and indexers to conform data structures to the new index.
Index.intersection(self, other[, sort])
Index.intersection
Form the intersection of two Index objects.
Index.union(self, other[, sort])
Index.union
Form the union of two Index objects.
Index.difference(self, other[, sort])
Index.difference
Return a new Index with elements from the index that are not in other.
Index.symmetric_difference(self, other[, …])
Index.symmetric_difference
Compute the symmetric difference of two Index objects.
Index.asof(self, label)
Index.asof
Return the label from the index, or, if not present, the previous one.
Index.asof_locs(self, where, mask)
Index.asof_locs
Find the locations (indices) of the labels from the index for every entry in the where argument.
Index.get_indexer(self, target[, method, …])
Index.get_indexer
Compute indexer and mask for new index given the current index.
Index.get_indexer_for(self, target, \*\*kwargs)
Index.get_indexer_for
Guaranteed return of an indexer even when non-unique.
Index.get_indexer_non_unique(self, target)
Index.get_indexer_non_unique
Index.get_level_values(self, level)
Index.get_level_values
Return an Index of values for requested level.
Index.get_loc(self, key[, method, tolerance])
Index.get_loc
Get integer location, slice or boolean mask for requested label.
Index.get_slice_bound(self, label, side, kind)
Index.get_slice_bound
Calculate slice bound that corresponds to given label.
Index.get_value(self, series, key)
Index.get_value
Fast lookup of value from 1-dimensional ndarray.
Index.isin(self, values[, level])
Index.isin
Return a boolean array where the index values are in values.
Index.slice_indexer(self[, start, end, …])
Index.slice_indexer
For an ordered or unique index, compute the slice indexer for input labels and step.
Index.slice_locs(self[, start, end, step, kind])
Index.slice_locs
Compute slice locations for input labels.
RangeIndex
Immutable Index implementing a monotonic integer range.
Int64Index
UInt64Index
Float64Index
RangeIndex.start
The value of the start parameter (0 if this was not supplied).
0
RangeIndex.stop
The value of the stop parameter.
RangeIndex.step
The value of the step parameter (1 if this was not supplied).
1
RangeIndex.from_range(data[, name, dtype])
RangeIndex.from_range
Create RangeIndex from a range object.
CategoricalIndex
Index based on an underlying Categorical.
Categorical
CategoricalIndex.codes
The category codes of this categorical.
CategoricalIndex.categories
The categories of this categorical.
CategoricalIndex.ordered
Whether the categories have an ordered relationship.
CategoricalIndex.rename_categories(self, …)
CategoricalIndex.rename_categories
Rename categories.
CategoricalIndex.reorder_categories(self, …)
CategoricalIndex.reorder_categories
Reorder categories as specified in new_categories.
CategoricalIndex.add_categories(self, …)
CategoricalIndex.add_categories
Add new categories.
CategoricalIndex.remove_categories(self, …)
CategoricalIndex.remove_categories
Remove the specified categories.
CategoricalIndex.remove_unused_categories(…)
CategoricalIndex.remove_unused_categories
Remove categories which are not used.
CategoricalIndex.set_categories(self, …)
CategoricalIndex.set_categories
Set the categories to the specified new_categories.
CategoricalIndex.as_ordered(self, \*args, …)
CategoricalIndex.as_ordered
Set the Categorical to be ordered.
CategoricalIndex.as_unordered(self, \*args, …)
CategoricalIndex.as_unordered
Set the Categorical to be unordered.
CategoricalIndex.map(self, mapper)
CategoricalIndex.map
CategoricalIndex.equals(self, other)
CategoricalIndex.equals
Determine if two CategoricalIndex objects contain the same elements.
IntervalIndex
Immutable index of intervals that are closed on the same side.
IntervalIndex.from_arrays(left, right, closed)
IntervalIndex.from_arrays
Construct from two arrays defining the left and right bounds.
IntervalIndex.from_tuples(data, closed[, …])
IntervalIndex.from_tuples
Construct an IntervalIndex from an array-like of tuples.
IntervalIndex.from_breaks(breaks, closed[, …])
IntervalIndex.from_breaks
Construct an IntervalIndex from an array of splits.
IntervalIndex.left
Return the left endpoints of each Interval in the IntervalArray as an Index.
IntervalIndex.right
Return the right endpoints of each Interval in the IntervalArray as an Index.
IntervalIndex.mid
Return the midpoint of each Interval in the IntervalArray as an Index.
IntervalIndex.closed
Whether the intervals are closed on the left-side, right-side, both or neither.
IntervalIndex.length
Return an Index with entries denoting the length of each Interval in the IntervalArray.
IntervalIndex.values
Return the IntervalIndex’s data as an IntervalArray.
IntervalIndex.is_empty
Indicates if an interval is empty, meaning it contains no points.
IntervalIndex.is_non_overlapping_monotonic
Return True if the IntervalArray is non-overlapping (no Intervals share points) and is either monotonic increasing or monotonic decreasing, else False.
IntervalIndex.is_overlapping
Return True if the IntervalIndex has overlapping intervals, else False.
IntervalIndex.get_loc(self, key, method, …)
IntervalIndex.get_loc
IntervalIndex.get_indexer(self, target, …)
IntervalIndex.get_indexer
IntervalIndex.set_closed(self, \*args, …)
IntervalIndex.set_closed
Return an IntervalArray identical to the current one, but closed on the specified side.
IntervalIndex.contains(self, \*args, \*\*kwargs)
IntervalIndex.contains
Check elementwise if the Intervals contain the value.
IntervalIndex.overlaps(self, \*args, \*\*kwargs)
IntervalIndex.overlaps
Check elementwise if an Interval overlaps the values in the IntervalArray.
IntervalIndex.to_tuples(self, \*args, \*\*kwargs)
IntervalIndex.to_tuples
Return an ndarray of tuples of the form (left, right).
MultiIndex
A multi-level, or hierarchical, index object for pandas objects.
IndexSlice
Create an object to more easily perform multi-index slicing.
MultiIndex.from_arrays(arrays[, sortorder, …])
MultiIndex.from_arrays
Convert arrays to MultiIndex.
MultiIndex.from_tuples(tuples[, sortorder, …])
MultiIndex.from_tuples
Convert list of tuples to MultiIndex.
MultiIndex.from_product(iterables[, …])
MultiIndex.from_product
Make a MultiIndex from the cartesian product of multiple iterables.
MultiIndex.from_frame(df[, sortorder, names])
MultiIndex.from_frame
Make a MultiIndex from a DataFrame.
MultiIndex.names
Names of levels in MultiIndex.
MultiIndex.levels
MultiIndex.codes
MultiIndex.nlevels
Integer number of levels in this MultiIndex.
MultiIndex.levshape
A tuple with the length of each level.
MultiIndex.set_levels(self, levels[, level, …])
MultiIndex.set_levels
Set new levels on MultiIndex.
MultiIndex.set_codes(self, codes[, level, …])
MultiIndex.set_codes
Set new codes on MultiIndex.
MultiIndex.to_flat_index(self)
MultiIndex.to_flat_index
Convert a MultiIndex to an Index of Tuples containing the level values.
MultiIndex.to_frame(self[, index, name])
MultiIndex.to_frame
Create a DataFrame with the levels of the MultiIndex as columns.
MultiIndex.is_lexsorted(self)
MultiIndex.is_lexsorted
Return True if the codes are lexicographically sorted.
MultiIndex.sortlevel(self[, level, …])
MultiIndex.sortlevel
Sort MultiIndex at the requested level.
MultiIndex.droplevel(self[, level])
MultiIndex.droplevel
MultiIndex.swaplevel(self[, i, j])
MultiIndex.swaplevel
Swap level i with level j.
MultiIndex.reorder_levels(self, order)
MultiIndex.reorder_levels
Rearrange levels using input order.
MultiIndex.remove_unused_levels(self)
MultiIndex.remove_unused_levels
Create a new MultiIndex from the current that removes unused levels, meaning that they are not expressed in the labels.
MultiIndex.get_loc(self, key[, method])
MultiIndex.get_loc
Get location for a label or a tuple of labels as an integer, slice or boolean mask.
MultiIndex.get_locs(self, seq)
MultiIndex.get_locs
Get location for a sequence of labels.
MultiIndex.get_loc_level(self, key[, level])
MultiIndex.get_loc_level
Get both the location for the requested label(s) and the resulting sliced index.
MultiIndex.get_indexer(self, target[, …])
MultiIndex.get_indexer
MultiIndex.get_level_values(self, level)
MultiIndex.get_level_values
Return vector of label values for requested level, equal to the length of the index.
DatetimeIndex
Immutable ndarray of datetime64 data, represented internally as int64, and which can be boxed to Timestamp objects that are subclasses of datetime and carry metadata such as frequency information.
DatetimeIndex.year
The year of the datetime.
DatetimeIndex.month
The month as January=1, December=12.
DatetimeIndex.day
DatetimeIndex.hour
The hours of the datetime.
DatetimeIndex.minute
The minutes of the datetime.
DatetimeIndex.second
The seconds of the datetime.
DatetimeIndex.microsecond
The microseconds of the datetime.
DatetimeIndex.nanosecond
The nanoseconds of the datetime.
DatetimeIndex.date
Returns numpy array of python datetime.date objects (namely, the date part of Timestamps without timezone information).
DatetimeIndex.time
Returns numpy array of datetime.time.
DatetimeIndex.timetz
Returns numpy array of datetime.time also containing timezone information.
DatetimeIndex.dayofyear
The ordinal day of the year.
DatetimeIndex.weekofyear
The week ordinal of the year.
DatetimeIndex.week
DatetimeIndex.dayofweek
The day of the week with Monday=0, Sunday=6.
DatetimeIndex.weekday
DatetimeIndex.quarter
The quarter of the date.
DatetimeIndex.tz
Return timezone, if any.
DatetimeIndex.freq
Return the frequency object if it is set, otherwise None.
DatetimeIndex.freqstr
Return the frequency object as a string if its set, otherwise None
DatetimeIndex.is_month_start
Indicates whether the date is the first day of the month.
DatetimeIndex.is_month_end
Indicates whether the date is the last day of the month.
DatetimeIndex.is_quarter_start
Indicator for whether the date is the first day of a quarter.
DatetimeIndex.is_quarter_end
Indicator for whether the date is the last day of a quarter.
DatetimeIndex.is_year_start
Indicate whether the date is the first day of a year.
DatetimeIndex.is_year_end
Indicate whether the date is the last day of the year.
DatetimeIndex.is_leap_year
Boolean indicator if the date belongs to a leap year.
DatetimeIndex.inferred_freq
Tryies to return a string representing a frequency guess, generated by infer_freq.
DatetimeIndex.indexer_at_time(self, time[, asof])
DatetimeIndex.indexer_at_time
Return index locations of index values at particular time of day (e.g.
DatetimeIndex.indexer_between_time(self, …)
DatetimeIndex.indexer_between_time
Return index locations of values between particular times of day (e.g., 9:00-9:30AM).
DatetimeIndex.normalize(self, \*args, \*\*kwargs)
DatetimeIndex.normalize
Convert times to midnight.
DatetimeIndex.strftime(self, \*args, \*\*kwargs)
DatetimeIndex.strftime
Convert to Index using specified date_format.
DatetimeIndex.snap(self[, freq])
DatetimeIndex.snap
Snap time stamps to nearest occurring frequency.
DatetimeIndex.tz_convert(self, \*args, …)
DatetimeIndex.tz_convert
Convert tz-aware Datetime Array/Index from one time zone to another.
DatetimeIndex.tz_localize(self, \*args, …)
DatetimeIndex.tz_localize
Localize tz-naive Datetime Array/Index to tz-aware Datetime Array/Index.
DatetimeIndex.round(self, \*args, \*\*kwargs)
DatetimeIndex.round
Perform round operation on the data to the specified freq.
DatetimeIndex.floor(self, \*args, \*\*kwargs)
DatetimeIndex.floor
Perform floor operation on the data to the specified freq.
DatetimeIndex.ceil(self, \*args, \*\*kwargs)
DatetimeIndex.ceil
Perform ceil operation on the data to the specified freq.
DatetimeIndex.month_name(self, \*args, …)
DatetimeIndex.month_name
Return the month names of the DateTimeIndex with specified locale.
DatetimeIndex.day_name(self, \*args, \*\*kwargs)
DatetimeIndex.day_name
Return the day names of the DateTimeIndex with specified locale.
DatetimeIndex.to_period(self, \*args, \*\*kwargs)
DatetimeIndex.to_period
Cast to PeriodArray/Index at a particular frequency.
DatetimeIndex.to_perioddelta(self, \*args, …)
DatetimeIndex.to_perioddelta
Calculate TimedeltaArray of difference between index values and index converted to PeriodArray at specified freq.
DatetimeIndex.to_pydatetime(self, \*args, …)
DatetimeIndex.to_pydatetime
Return Datetime Array/Index as object ndarray of datetime.datetime objects.
DatetimeIndex.to_series(self[, keep_tz, …])
DatetimeIndex.to_series
Create a Series with both index and values equal to the index keys useful with map for returning an indexer based on an index.
DatetimeIndex.to_frame(self[, index, name])
DatetimeIndex.to_frame
DatetimeIndex.mean(self, \*args, \*\*kwargs)
DatetimeIndex.mean
Return the mean value of the Array.
TimedeltaIndex
Immutable ndarray of timedelta64 data, represented internally as int64, and which can be boxed to timedelta objects.
TimedeltaIndex.days
Number of days for each element.
TimedeltaIndex.seconds
Number of seconds (>= 0 and less than 1 day) for each element.
TimedeltaIndex.microseconds
Number of microseconds (>= 0 and less than 1 second) for each element.
TimedeltaIndex.nanoseconds
Number of nanoseconds (>= 0 and less than 1 microsecond) for each element.
TimedeltaIndex.components
Return a dataframe of the components (days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds) of the Timedeltas.
TimedeltaIndex.inferred_freq
TimedeltaIndex.to_pytimedelta(self, \*args, …)
TimedeltaIndex.to_pytimedelta
Return Timedelta Array/Index as object ndarray of datetime.timedelta objects.
TimedeltaIndex.to_series(self[, index, name])
TimedeltaIndex.to_series
TimedeltaIndex.round(self, \*args, \*\*kwargs)
TimedeltaIndex.round
TimedeltaIndex.floor(self, \*args, \*\*kwargs)
TimedeltaIndex.floor
TimedeltaIndex.ceil(self, \*args, \*\*kwargs)
TimedeltaIndex.ceil
TimedeltaIndex.to_frame(self[, index, name])
TimedeltaIndex.to_frame
TimedeltaIndex.mean(self, \*args, \*\*kwargs)
TimedeltaIndex.mean
PeriodIndex
Immutable ndarray holding ordinal values indicating regular periods in time.
PeriodIndex.day
The days of the period.
PeriodIndex.dayofweek
PeriodIndex.dayofyear
PeriodIndex.days_in_month
The number of days in the month.
PeriodIndex.daysinmonth
PeriodIndex.end_time
PeriodIndex.freq
PeriodIndex.freqstr
PeriodIndex.hour
The hour of the period.
PeriodIndex.is_leap_year
Logical indicating if the date belongs to a leap year.
PeriodIndex.minute
The minute of the period.
PeriodIndex.month
PeriodIndex.quarter
PeriodIndex.qyear
PeriodIndex.second
The second of the period.
PeriodIndex.start_time
PeriodIndex.week
PeriodIndex.weekday
PeriodIndex.weekofyear
PeriodIndex.year
The year of the period.
PeriodIndex.asfreq(self, \*args, \*\*kwargs)
PeriodIndex.asfreq
Convert the Period Array/Index to the specified frequency freq.
PeriodIndex.strftime(self, \*args, \*\*kwargs)
PeriodIndex.strftime
PeriodIndex.to_timestamp(self, \*args, …)
PeriodIndex.to_timestamp
Cast to DatetimeArray/Index.