Skip to content

Commit 2ec41bd

Browse files
Paul Leesimonjayhawkins
Paul Lee
authored andcommitted
CLN: Update old .format to f-string (#30547)
1 parent e817fff commit 2ec41bd

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

pandas/core/arrays/boolean.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -755,9 +755,8 @@ def logical_method(self, other):
755755

756756
if other_is_scalar and not (other is libmissing.NA or lib.is_bool(other)):
757757
raise TypeError(
758-
"'other' should be pandas.NA or a bool. Got {} instead.".format(
759-
type(other).__name__
760-
)
758+
"'other' should be pandas.NA or a bool. "
759+
f"Got {type(other).__name__} instead."
761760
)
762761

763762
if not other_is_scalar and len(self) != len(other):
@@ -772,7 +771,7 @@ def logical_method(self, other):
772771

773772
return BooleanArray(result, mask)
774773

775-
name = "__{name}__".format(name=op.__name__)
774+
name = f"__{op.__name__}__"
776775
return set_function_name(logical_method, name, cls)
777776

778777
@classmethod
@@ -819,7 +818,7 @@ def cmp_method(self, other):
819818

820819
return BooleanArray(result, mask, copy=False)
821820

822-
name = "__{name}__".format(name=op.__name__)
821+
name = f"__{op.__name__}"
823822
return set_function_name(cmp_method, name, cls)
824823

825824
def _reduce(self, name, skipna=True, **kwargs):
@@ -922,7 +921,7 @@ def boolean_arithmetic_method(self, other):
922921

923922
return self._maybe_mask_result(result, mask, other, op_name)
924923

925-
name = "__{name}__".format(name=op_name)
924+
name = f"__{op_name}__"
926925
return set_function_name(boolean_arithmetic_method, name, cls)
927926

928927

0 commit comments

Comments
 (0)