elphick.geomet.utils.pandas.MeanIntervalIndex

class elphick.geomet.utils.pandas.MeanIntervalIndex(data, mean_values=None)[source]

MeanIntervalIndex is a subclass of pd.IntervalIndex that calculates the mean of the interval bounds.

__init__(data, mean_values=None)[source]

Methods

__init__(data[, mean_values])

all(*args, **kwargs)

Return whether all elements are Truthy.

any(*args, **kwargs)

Return whether any element is Truthy.

append(other)

Append a collection of Index options together.

argmax([axis, skipna])

Return int position of the largest value in the Series.

argmin([axis, skipna])

Return int position of the smallest value in the Series.

argsort(*args, **kwargs)

Return the integer indices that would sort the index.

asof(label)

Return the label from the index, or, if not present, the previous one.

asof_locs(where, mask)

Return the locations (indices) of labels in the index.

astype(dtype[, copy])

Create an Index with values cast to dtypes.

contains(*args, **kwargs)

Check elementwise if the Intervals contain the value.

copy([name, deep])

Make a copy of this object.

delete(loc)

Make new Index with passed location(-s) deleted.

diff([periods])

Computes the difference between consecutive values in the Index object.

difference(other[, sort])

Return a new Index with elements of index not in other.

drop(labels[, errors])

Make new Index with passed list of labels deleted.

drop_duplicates(*[, keep])

Return Index with duplicate values removed.

droplevel([level])

Return index with requested level(s) removed.

dropna([how])

Return Index without NA/NaN values.

duplicated([keep])

Indicate duplicate index values.

equals(other)

Determine if two Index object are equal.

factorize([sort, use_na_sentinel])

Encode the object as an enumerated type or categorical variable.

fillna([value, downcast])

Fill NA/NaN values with the specified value.

format([name, formatter, na_rep])

Render a string representation of the Index.

from_arrays(left, right[, closed, name, ...])

Construct from two arrays defining the left and right bounds.

from_breaks(breaks[, closed, name, copy, dtype])

Construct an IntervalIndex from an array of splits.

from_tuples(data[, closed, name, copy, dtype])

Construct an IntervalIndex from an array-like of tuples.

get_indexer(target[, method, limit, tolerance])

Compute indexer and mask for new index given the current index.

get_indexer_for(target)

Guaranteed return of an indexer even when non-unique.

get_indexer_non_unique(target)

Compute indexer and mask for new index given the current index.

get_level_values(level)

Return an Index of values for requested level.

get_loc(key)

Get integer location, slice or boolean mask for requested label.

get_slice_bound(label, side)

Calculate slice bound that corresponds to given label.

groupby(values)

Group the index labels by a given array of values.

holds_integer()

Whether the type is an integer type.

identical(other)

Similar to equals, but checks that object attributes and types are also equal.

infer_objects([copy])

If we have an object dtype, try to infer a non-object dtype.

insert(loc, item)

Make new Index inserting new item at location.

intersection(other[, sort])

Form the intersection of two Index objects.

is_(other)

More flexible, faster check like is but that works through views.

is_boolean()

Check if the Index only consists of booleans.

is_categorical()

Check if the Index holds categorical data.

is_floating()

Check if the Index is a floating type.

is_integer()

Check if the Index only consists of integers.

is_interval()

Check if the Index holds Interval objects.

is_numeric()

Check if the Index only consists of numeric data.

is_object()

Check if the Index is of the object dtype.

isin(values[, level])

Return a boolean array where the index values are in values.

isna()

Detect missing values.

isnull()

Detect missing values.

item()

Return the first element of the underlying data as a Python scalar.

join(other, *[, how, level, ...])

Compute join_index and indexers to conform data structures to the new index.

map(mapper[, na_action])

Map values using an input mapping or function.

max([axis, skipna])

Return the maximum value of the Index.

memory_usage([deep])

Memory usage of the values.

min([axis, skipna])

Return the minimum value of the Index.

notna()

Detect existing (non-missing) values.

notnull()

Detect existing (non-missing) values.

nunique([dropna])

Return number of unique elements in the object.

overlaps(*args, **kwargs)

Check elementwise if an Interval overlaps the values in the IntervalArray.

putmask(mask, value)

Return a new Index of the values set with the mask.

ravel([order])

Return a view on self.

reindex(target[, method, level, limit, ...])

Create index with target's values.

rename(name[, inplace])

Alter Index or MultiIndex name.

repeat(repeats[, axis])

Repeat elements of a Index.

round([decimals])

Round each value in the Index to the given number of decimals.

searchsorted(value[, side, sorter])

Find indices where elements should be inserted to maintain order.

set_closed(*args, **kwargs)

Return an identical IntervalArray closed on the specified side.

set_names(names, *[, level, inplace])

Set Index or MultiIndex name.

shift([periods, freq])

Shift index by desired number of time frequency increments.

slice_indexer([start, end, step])

Compute the slice indexer for input labels and step.

slice_locs([start, end, step])

Compute slice locations for input labels.

sort(*args, **kwargs)

Use sort_values instead.

sort_values([return_indexer, ascending, ...])

Return a sorted copy of the index.

sortlevel([level, ascending, ...])

For internal compatibility with the Index API.

symmetric_difference(other[, result_name, sort])

Compute the symmetric difference of two Index objects.

take(indices[, axis, allow_fill, fill_value])

Return a new Index of the values selected by the indices.

to_flat_index()

Identity method.

to_frame([index, name])

Create a DataFrame with a column containing the Index.

to_list()

Return a list of the values.

to_numpy([dtype, copy, na_value])

A NumPy ndarray representing the values in this Series or Index.

to_series([index, name])

Create a Series with both index and values equal to the index keys.

to_tuples(*args, **kwargs)

Return an ndarray (if self is IntervalArray) or Index (if self is IntervalIndex) of tuples of the form (left, right).

tolist()

Return a list of the values.

transpose(*args, **kwargs)

Return the transpose, which is by definition self.

union(other[, sort])

Form the union of two Index objects.

unique([level])

Return unique values in the index.

value_counts([normalize, sort, ascending, ...])

Return a Series containing counts of unique values.

view([cls])

where(cond[, other])

Replace values where the condition is False.

Attributes

T

Return the transpose, which is by definition self.

array

The ExtensionArray of the data backing this Series or Index.

closed

String describing the inclusive side the intervals.

closed_left

Check if the interval is closed on the left side.

closed_right

Check if the interval is closed on the right side.

dtype

Return the dtype object of the underlying data.

empty

has_duplicates

Check if the Index has duplicate values.

hasnans

Return True if there are any NaNs.

inferred_type

Return a string of the type inferred from the values

is_empty

Indicates if an interval is empty, meaning it contains no points.

is_monotonic_decreasing

Return True if the IntervalIndex is monotonic decreasing (only equal or decreasing values), else False

is_monotonic_increasing

Return a boolean if the values are equal or increasing.

is_non_overlapping_monotonic

Return a boolean whether the IntervalArray is non-overlapping and monotonic.

is_overlapping

Return True if the IntervalIndex has overlapping intervals, else False.

is_unique

Return True if the IntervalIndex contains unique elements, else False.

left

length

mean

mid

name

Return Index or MultiIndex name.

names

nbytes

Return the number of bytes in the underlying data.

ndim

Number of dimensions of the underlying data, by definition 1.

nlevels

Number of levels.

open_left

Check if the interval is open on the left side.

open_right

Check if the interval is open on the right side.

right

shape

Return a tuple of the shape of the underlying data.

size

Return the number of elements in the underlying data.

values

Return an array representing the data in the Index.