Exception raised when attempting to use an invalid index key. This exception is triggered when a user attempts to access or manipulate data in a pandas DataFrame or Series using an index key that is not valid for the given object. This may occur in cases such as using a malformed
| 584 | |
| 585 | |
| 586 | class InvalidIndexError(Exception): |
| 587 | """ |
| 588 | Exception raised when attempting to use an invalid index key. |
| 589 | |
| 590 | This exception is triggered when a user attempts to access or manipulate |
| 591 | data in a pandas DataFrame or Series using an index key that is not valid |
| 592 | for the given object. This may occur in cases such as using a malformed |
| 593 | slice, a mismatched key for a ``MultiIndex``, or attempting to access an index |
| 594 | element that does not exist. |
| 595 | |
| 596 | See Also |
| 597 | -------- |
| 598 | MultiIndex : A multi-level, or hierarchical, index object for pandas objects. |
| 599 | |
| 600 | Examples |
| 601 | -------- |
| 602 | >>> idx = pd.MultiIndex.from_product([["x", "y"], [0, 1]]) |
| 603 | >>> df = pd.DataFrame([[1, 1, 2, 2], [3, 3, 4, 4]], columns=idx) |
| 604 | >>> df |
| 605 | x y |
| 606 | 0 1 0 1 |
| 607 | 0 1 1 2 2 |
| 608 | 1 3 3 4 4 |
| 609 | >>> df[:, 0] |
| 610 | Traceback (most recent call last): |
| 611 | InvalidIndexError: (slice(None, None, None), 0) |
| 612 | """ |
| 613 | |
| 614 | |
| 615 | class DataError(Exception): |
no outgoing calls
no test coverage detected