Skip to content

STY - fstrings on frame.py & numeric.py #30197

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

Merged
merged 3 commits into from
Dec 11, 2019
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: 1 addition & 1 deletion pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -7792,7 +7792,7 @@ def _get_agg_axis(self, axis_num):
elif axis_num == 1:
return self.index
else:
raise ValueError("Axis must be 0 or 1 (got %r)" % axis_num)
raise ValueError(f"Axis must be 0 or 1 (got {repr(axis_num)})")

def mode(self, axis=0, numeric_only=False, dropna=True):
"""
Expand Down
8 changes: 3 additions & 5 deletions pandas/core/indexes/numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,16 @@ def _convert_tolerance(self, tolerance, target):
if tolerance.ndim > 0:
raise ValueError(
(
"tolerance argument for %s must contain "
f"tolerance argument for {type(self).__name__} must contain "
"numeric elements if it is list type"
)
% (type(self).__name__,)
)
else:
raise ValueError(
(
"tolerance argument for %s must be numeric "
"if it is a scalar: %r"
f"tolerance argument for {type(self).__name__} must be numeric "
f"if it is a scalar: {repr(tolerance)}"
)
% (type(self).__name__, tolerance)
)
return tolerance

Expand Down