Make a copy of this object.
Name is set on the new object.
Set name for new object.
Index refer to new object which is a copy of this object.
Notes
In most cases, there should be no functional difference from using deep, but if deep is passed it will attempt to deepcopy.
Examples
>>> idx = pd.Index(['a', 'b', 'c'])
>>> new_idx = idx.copy()
>>> idx is new_idx
False
© 2008–2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
© 2011–2025, Open source contributors
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/2.3.0/reference/api/pandas.Index.copy.html