MCPcopy Index your code
hub / github.com/pydata/xarray / rename

Method rename

xarray/core/indexes.py:418–447  ·  view source on GitHub ↗

Maybe update the index with new coordinate and dimension names. This method should be re-implemented in subclasses of Index if it has attributes that depend on coordinate or dimension names. By default (if not re-implemented), it returns the index itself. Warning:

(
        self,
        name_dict: Mapping[Any, Hashable],
        dims_dict: Mapping[Any, Hashable],
    )

Source from the content-addressed store, hash-verified

416 return None
417
418 def rename(
419 self,
420 name_dict: Mapping[Any, Hashable],
421 dims_dict: Mapping[Any, Hashable],
422 ) -> Self:
423 """Maybe update the index with new coordinate and dimension names.
424
425 This method should be re-implemented in subclasses of Index if it has
426 attributes that depend on coordinate or dimension names.
427
428 By default (if not re-implemented), it returns the index itself.
429
430 Warning: the input names are not filtered for this method, they may
431 correspond to any variable or dimension of a Dataset or a DataArray.
432
433 Parameters
434 ----------
435 name_dict : dict-like
436 Mapping of current variable or coordinate names to the desired names,
437 as passed from :py:meth:`Dataset.rename_vars`.
438 dims_dict : dict-like
439 Mapping of current dimension names to the desired names, as passed
440 from :py:meth:`Dataset.rename_dims`.
441
442 Returns
443 -------
444 renamed : Index
445 Index with renamed attributes.
446 """
447 return self
448
449 def copy(self, deep: bool = True) -> Self:
450 """Return a (deep) copy of this index.

Callers 15

_get_index_and_itemsMethod · 0.45
_flox_reduceMethod · 0.45
mapMethod · 0.45
mapMethod · 0.45
renameMethod · 0.45
keep_levelsMethod · 0.45
renameMethod · 0.45
_dataarray_concatFunction · 0.45
_calc_idxminmaxFunction · 0.45
duplicate_and_mergeMethod · 0.45
test_groupby_drops_nansFunction · 0.45

Calls

no outgoing calls

Tested by 15

duplicate_and_mergeMethod · 0.36
test_groupby_drops_nansFunction · 0.36
test_groupby_mathMethod · 0.36
factorizeMethod · 0.36
test_multiple_groupersFunction · 0.36
test_mergeMethod · 0.36
test_mergeMethod · 0.36
test_dask_is_lazyMethod · 0.36
test_sel_dataarrayMethod · 0.36
test_selMethod · 0.36