diff --git a/pandas/io/html.py b/pandas/io/html.py index cc93bba4603bf..3521bad375aa6 100644 --- a/pandas/io/html.py +++ b/pandas/io/html.py @@ -102,9 +102,7 @@ def _get_skiprows(skiprows): return skiprows elif skiprows is None: return 0 - raise TypeError( - f"'{type(skiprows).__name__}' is not a valid type for skipping rows" - ) + raise TypeError(f"{type(skiprows).__name__} is not a valid type for skipping rows") def _read(obj): diff --git a/pandas/io/parsers.py b/pandas/io/parsers.py index aeade1d5ed2c2..2d8787d1c4874 100755 --- a/pandas/io/parsers.py +++ b/pandas/io/parsers.py @@ -913,8 +913,8 @@ def _get_options_with_defaults(self, engine): pass else: raise ValueError( - "The %r option is not supported with the" - " %r engine" % (argname, engine) + f"The {repr(argname)} option is not supported with the" + f" {repr(engine)} engine" ) else: value = _deprecated_defaults.get(argname, default) @@ -1079,8 +1079,8 @@ def _clean_options(self, options, engine): if converters is not None: if not isinstance(converters, dict): raise TypeError( - f"Type converters must be a dict or subclass, " - f"input was a {repr(type(converters).__name__)}" + "Type converters must be a dict or subclass, " + f"input was a {type(converters).__name__}" ) else: converters = {} @@ -3608,7 +3608,7 @@ def __init__(self, f, colspecs, delimiter, comment, skiprows=None, infer_nrows=1 if not isinstance(self.colspecs, (tuple, list)): raise TypeError( "column specifications must be a list or tuple, " - "input was a %r" % type(colspecs).__name__ + f"input was a {type(colspecs).__name__}" ) for colspec in self.colspecs: