-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
CLN: replacing str.format with f-strings in several files. #29547 #30612
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice! one minor comment (not related to the issue though)
if x > 0 | ||
else "color: {z}".format(z=z) | ||
) | ||
g = lambda x, y, z: f"color: {z}" if x > 0 else f"color: {z}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not related to the issue, maybe y
can be removed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea! I'll look into taking care of it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jlamborn324 for the PR. generally lgtm. a few minor suggestions
Co-Authored-By: Simon Hawkins <simonjayhawkins@gmail.com>
@@ -711,7 +709,7 @@ def format_func(x): | |||
|
|||
def test_to_string_with_formatters_unicode(self): | |||
df = DataFrame({"c/\u03c3": [1, 2, 3]}) | |||
result = df.to_string(formatters={"c/\u03c3": lambda x: "{x}".format(x=x)}) | |||
result = df.to_string(formatters={"c/\u03c3": lambda x: f"{x}"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this just be str(x)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call. Thank you for your help!
Co-Authored-By: Simon Hawkins <simonjayhawkins@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jlamborn324 lgtm
Thanks for the clean up @jlamborn324 |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff