Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,8 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
pandas.errors.AccessorRegistrationWarning \
pandas.errors.AttributeConflictWarning \
pandas.errors.DataError \
pandas.errors.EmptyDataError \
pandas.errors.IncompatibilityWarning \
pandas.errors.InvalidComparison \
pandas.errors.InvalidIndexError \
pandas.errors.InvalidVersion \
pandas.errors.IntCastingNaNError \
pandas.errors.LossySetitemError \
Expand Down
22 changes: 22 additions & 0 deletions pandas/errors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@ class DtypeWarning(Warning):
class EmptyDataError(ValueError):
"""
Exception raised in ``pd.read_csv`` when empty data or header is encountered.

Examples
--------
>>> from io import StringIO
>>> empty = StringIO()
>>> pd.read_csv(empty)
Traceback (most recent call last):
EmptyDataError: No columns to parse from file
"""


Expand Down Expand Up @@ -234,6 +242,20 @@ class DuplicateLabelError(ValueError):
class InvalidIndexError(Exception):
"""
Exception raised when attempting to use an invalid index key.

Examples
--------
>>> idx = pd.MultiIndex.from_product([["x", "y"], [0, 1]])
>>> df = pd.DataFrame([[1, 1, 2, 2],
... [3, 3, 4, 4]], columns=idx)
>>> df
x y
0 1 0 1
0 1 1 2 2
1 3 3 4 4
>>> df[:, 0]
Traceback (most recent call last):
InvalidIndexError: (slice(None, None, None), 0)
"""


Expand Down