You are viewing documentation about an older version (1.21.0). View latest version

modin.pandas.Index.copy¶

Index.copy(name: Hashable | None = None, deep: bool = False) → Index[source]¶

Make a copy of this object.

Name is set on the new object.

Parameters:
  • name (Label, optional) – Set name for new object.

  • deep (bool, default False) –

Returns:

Index refers to new object which is a copy of this object.

Return type:

Index

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
Copy