xarray.indexes.PandasMultiIndex#
- class xarray.indexes.PandasMultiIndex(array, dim, level_coords_dtype=None)[source]#
Wrap a pandas.MultiIndex as an xarray compatible index.
Methods
__init__
(array, dim[, level_coords_dtype])concat
(indexes, dim[, positions])Create a new index by concatenating one or more indexes of the same type.
copy
([deep])Return a (deep) copy of this index.
create_variables
([variables])Maybe create new coordinate variables from this index.
equals
(other, *[, exclude])Compare this index with another index of the same type.
from_variables
(variables, *, options)Create a new index object from one or more coordinate variables.
from_variables_maybe_expand
(dim, ...)Create a new multi-index maybe by expanding an existing one with new variables as index levels.
isel
(indexers)Maybe returns a new index from the current index itself indexed by positional indexers.
join
(other[, how])Return a new index from the combination of this index with another index of the same type.
keep_levels
(level_variables)Keep only the provided levels and return a new multi-index with its corresponding coordinates.
reindex_like
(other[, method, tolerance])Query the index with another index of the same type.
rename
(name_dict, dims_dict)Maybe update the index with new coordinate and dimension names.
reorder_levels
(level_variables)Re-arrange index levels using input order and return a new multi-index with its corresponding coordinates.
roll
(shifts)Roll this index by an offset along one or more dimensions.
sel
(labels[, method, tolerance])Query the index with arbitrary coordinate label indexers.
should_add_coord_to_array
(name, var, dims)Define whether or not an index coordinate variable should be added to a new DataArray.
stack
(variables, dim)Create a new Pandas MultiIndex from the product of 1-d variables (levels) along a new dimension.
to_pandas_index
()Cast this xarray index to a pandas.Index object or raise a
TypeError
if this is not supported.unstack
()Unstack a (multi-)index into multiple (single) indexes.
Attributes
coord_dtype
dim
index
level_coords_dtype