Return a (deep) copy of this index. Implementation in subclasses of Index is optional. The base class implements the default (deep) copy semantics. Parameters ---------- deep : bool, optional If true (default), a copy of the internal structures
(self, deep: bool = True)
| 447 | return self |
| 448 | |
| 449 | def copy(self, deep: bool = True) -> Self: |
| 450 | """Return a (deep) copy of this index. |
| 451 | |
| 452 | Implementation in subclasses of Index is optional. The base class |
| 453 | implements the default (deep) copy semantics. |
| 454 | |
| 455 | Parameters |
| 456 | ---------- |
| 457 | deep : bool, optional |
| 458 | If true (default), a copy of the internal structures |
| 459 | (e.g., wrapped index) is returned with the new object. |
| 460 | |
| 461 | Returns |
| 462 | ------- |
| 463 | index : Index |
| 464 | A new Index object. |
| 465 | """ |
| 466 | return self._copy(deep=deep) |
| 467 | |
| 468 | def __copy__(self) -> Self: |
| 469 | return self.copy(deep=False) |