- Index.copy(name=None, deep=False)#
Make a copy of this object.
Name is set on the new object.
name (Label, optional) – Set name for new object.
deep (bool, default False) –
Index refer to new object which is a copy of this object.
- Return type
In most cases, there should be no functional difference from using
deep, but if
deepis passed it will attempt to deepcopy.
>>> idx = pd.Index(['a', 'b', 'c']) >>> new_idx = idx.copy() >>> idx is new_idx False
This docstring was copied from pandas.core.indexes.base.Index.