MCPcopy
hub / github.com/pandas-dev/pandas / _shallow_copy

Method _shallow_copy

pandas/core/indexes/base.py:762–777  ·  view source on GitHub ↗

Create a new Index with the same class as the caller, don't copy the data, use the same object attributes with passed in attributes taking precedence. *this is an internal non-public method* Parameters ---------- values : the values to creat

(self, values, name: Hashable = no_default)

Source from the content-addressed store, hash-verified

760 # Index Internals Methods
761
762 def _shallow_copy(self, values, name: Hashable = no_default) -> Self:
763 """
764 Create a new Index with the same class as the caller, don't copy the
765 data, use the same object attributes with passed in attributes taking
766 precedence.
767
768 *this is an internal non-public method*
769
770 Parameters
771 ----------
772 values : the values to create the new Index, optional
773 name : Label, defaults to self.name
774 """
775 name = self._name if name is no_default else name
776
777 return self._simple_new(values, name=name, refs=self._references)
778
779 def _view(self) -> Self:
780 """

Calls 1

_simple_newMethod · 0.95