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.
isel(indexers)Maybe return a new index from this index indexed by positional indexers.
join(other[, how])Return a new index by combining this index with another of the same type.
keep_levels(level_variables)Keep only the provided levels.
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.
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 an index coordinate variable should be added to a DataArray.
stack(variables, dim)Create a new Pandas MultiIndex from the product of 1-d variables (levels).
to_pandas_index()Cast this xarray index to a pandas.Index object.
unstack()Unstack a (multi-)index into multiple (single) indexes.
Attributes
coord_dtypedimindexlevel_coords_dtype