Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: Rewriting of ParserError doc + minor spacing #25421

Merged
Merged
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
17 changes: 12 additions & 5 deletions pandas/errors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@

class PerformanceWarning(Warning):
"""
Warning raised when there is a possible
performance impact.
Warning raised when there is a possible performance impact.
"""


class UnsupportedFunctionCall(ValueError):
"""
Exception raised when attempting to call a numpy function
on a pandas object, but that function is not supported by
the object e.g. ``np.cumsum(groupby_object)``.
"""


class UnsortedIndexError(KeyError):
"""
Error raised when attempting to get a slice of a MultiIndex,
Expand All @@ -31,9 +32,15 @@ class UnsortedIndexError(KeyError):

class ParserError(ValueError):
"""
Exception that is raised by an error encountered in `pd.read_csv`.
Exception that is raised by an error encountered in parsing file contents.

This is a generic error raised for errors encountered when functions like
`read_csv` or `read_html` are parsing contents of a file.

e.g. HTML Parsing will raise this error.
See Also
--------
read_csv : Read CSV (comma-separated) file into a DataFrame.
read_html : Read HTML table into a DataFrame.
"""


Expand Down Expand Up @@ -182,4 +189,4 @@ def __str__(self):
else:
name = self.class_instance.__class__.__name__
msg = "This {methodtype} must be defined in the concrete class {name}"
return (msg.format(methodtype=self.methodtype, name=name))
return msg.format(methodtype=self.methodtype, name=name)