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

Method _shallow_copy

pandas/core/indexes/multi.py:1290–1305  ·  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: np.ndarray, name=lib.no_default)

Source from the content-addressed store, hash-verified

1288 return type(self).from_tuples
1289
1290 def _shallow_copy(self, values: np.ndarray, name=lib.no_default) -> MultiIndex:
1291 """
1292 Create a new Index with the same class as the caller, don't copy the
1293 data, use the same object attributes with passed in attributes taking
1294 precedence.
1295
1296 *this is an internal non-public method*
1297
1298 Parameters
1299 ----------
1300 values : the values to create the new Index, optional
1301 name : Label, defaults to self.name
1302 """
1303 names = name if name is not lib.no_default else self.names
1304
1305 return type(self).from_tuples(values, sortorder=None, names=names)
1306
1307 def _view(self) -> MultiIndex:
1308 result = type(self)(

Callers 1

_get_level_valuesMethod · 0.45

Calls 1

from_tuplesMethod · 0.45

Tested by

no test coverage detected