Skip to content

Commit 3a66181

Browse files
author
MomIsBestFriend
committed
Fixes for @jreback review
1 parent d26d626 commit 3a66181

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

pandas/core/nanops.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def _f(*args, **kwargs):
6262
if any(self.check(obj) for obj in obj_iter):
6363
f_name = f.__name__.replace("nan", "")
6464
raise TypeError(
65-
f"reduction operation {repr(f_name)} not allowed for this dtype"
65+
f"reduction operation '{f_name}' not allowed for this dtype"
6666
)
6767
try:
6868
with np.errstate(invalid="ignore"):

pandas/core/reshape/concat.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,8 @@ def _get_concat_axis(self) -> Index:
542542
for i, x in enumerate(self.objs):
543543
if not isinstance(x, Series):
544544
raise TypeError(
545-
f"Cannot concatenate type 'Series' with object "
546-
f"of type {repr(type(x).__name__)}"
545+
f"Cannot concatenate type 'Series' with "
546+
f"object of type '{type(x).__name__}'"
547547
)
548548
if x.name is not None:
549549
names[i] = x.name

pandas/core/sorting.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def lexsort_indexer(keys, orders=None, na_position="last"):
208208
cat = Categorical(key, ordered=True)
209209

210210
if na_position not in ["last", "first"]:
211-
raise ValueError(f"invalid na_position: {repr(na_position)}")
211+
raise ValueError(f"invalid na_position: '{na_position}'")
212212

213213
n = len(cat.categories)
214214
codes = cat.codes.copy()

pandas/core/strings.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1933,8 +1933,8 @@ def _forbid_nonstring_types(func):
19331933
def wrapper(self, *args, **kwargs):
19341934
if self._inferred_dtype not in allowed_types:
19351935
msg = (
1936-
f"Cannot use .str.{func_name} with values of inferred dtype "
1937-
f"{repr(self._inferred_dtype)}."
1936+
f"Cannot use .str.{func_name} with values of "
1937+
f"inferred dtype '{self._inferred_dtype}'."
19381938
)
19391939
raise TypeError(msg)
19401940
return func(self, *args, **kwargs)

0 commit comments

Comments
 (0)