MCPcopy
hub / github.com/pydata/xarray / copy

Method copy

xarray/core/indexes.py:449–466  ·  view source on GitHub ↗

Return a (deep) copy of this index. Implementation in subclasses of Index is optional. The base class implements the default (deep) copy semantics. Parameters ---------- deep : bool, optional If true (default), a copy of the internal structures

(self, deep: bool = True)

Source from the content-addressed store, hash-verified

447 return self
448
449 def copy(self, deep: bool = True) -> Self:
450 """Return a (deep) copy of this index.
451
452 Implementation in subclasses of Index is optional. The base class
453 implements the default (deep) copy semantics.
454
455 Parameters
456 ----------
457 deep : bool, optional
458 If true (default), a copy of the internal structures
459 (e.g., wrapped index) is returned with the new object.
460
461 Returns
462 -------
463 index : Index
464 A new Index object.
465 """
466 return self._copy(deep=deep)
467
468 def __copy__(self) -> Self:
469 return self.copy(deep=False)

Callers 15

__copy__Method · 0.95
test_vectorized_indexingFunction · 0.45
test_assert_identicalFunction · 0.45
setupMethod · 0.45
_encode_coordinatesFunction · 0.45
_factorize_uniqueMethod · 0.45
_factorize_dummyMethod · 0.45
factorizeMethod · 0.45
factorizeMethod · 0.45
convert_calendarFunction · 0.45
interp_calendarFunction · 0.45
unpack_for_encodingFunction · 0.45

Calls 1

_copyMethod · 0.95

Tested by 15

test_vectorized_indexingFunction · 0.36
test_assert_identicalFunction · 0.36
test_label_from_attrsMethod · 0.36
test_plot_nansMethod · 0.36
test_datetime_hueMethod · 0.36
test_legend_labelsMethod · 0.36
open_datasetMethod · 0.36
open_datasetMethod · 0.36