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

Method _view

pandas/core/indexes/base.py:779–786  ·  view source on GitHub ↗

fastpath to make a shallow copy, i.e. new object with same data.

(self)

Source from the content-addressed store, hash-verified

777 return self._simple_new(values, name=name, refs=self._references)
778
779 def _view(self) -> Self:
780 """
781 fastpath to make a shallow copy, i.e. new object with same data.
782 """
783 result = self._simple_new(self._values, name=self._name, refs=self._references)
784
785 result._cache = self._cache
786 return result
787
788 @final
789 def _rename(self, name: Hashable) -> Self:

Callers 15

_renameMethod · 0.95
viewMethod · 0.95
to_seriesMethod · 0.95
set_namesMethod · 0.95
fillnaMethod · 0.95
dropnaMethod · 0.95
uniqueMethod · 0.95
drop_duplicatesMethod · 0.95
_join_emptyMethod · 0.95
time_shallow_copyMethod · 0.45
time_shallow_copyMethod · 0.45
time_shallow_copyMethod · 0.45

Calls 1

_simple_newMethod · 0.95

Tested by 4

test_shallow_copyFunction · 0.36
test_changing_namesFunction · 0.36