Skip to content

Commit

Permalink
Fixes for @jreback review
Browse files Browse the repository at this point in the history
  • Loading branch information
MomIsBestFriend committed Dec 4, 2019
1 parent d26d626 commit cac7fba
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pandas/core/nanops.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def _f(*args, **kwargs):
if any(self.check(obj) for obj in obj_iter):
f_name = f.__name__.replace("nan", "")
raise TypeError(
f"reduction operation {repr(f_name)} not allowed for this dtype"
f"reduction operation '{f_name}' not allowed for this dtype"
)
try:
with np.errstate(invalid="ignore"):
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/reshape/concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,8 @@ def _get_concat_axis(self) -> Index:
for i, x in enumerate(self.objs):
if not isinstance(x, Series):
raise TypeError(
f"Cannot concatenate type 'Series' with object "
f"of type {repr(type(x).__name__)}"
f"Cannot concatenate type 'Series' with "
f"object of type '{type(x).__name__}"
)
if x.name is not None:
names[i] = x.name
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/sorting.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def lexsort_indexer(keys, orders=None, na_position="last"):
cat = Categorical(key, ordered=True)

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

n = len(cat.categories)
codes = cat.codes.copy()
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -1933,8 +1933,8 @@ def _forbid_nonstring_types(func):
def wrapper(self, *args, **kwargs):
if self._inferred_dtype not in allowed_types:
msg = (
f"Cannot use .str.{func_name} with values of inferred dtype "
f"{repr(self._inferred_dtype)}."
f"Cannot use .str.{func_name} with values of "
f"inferred dtype '{self._inferred_dtype}'."
)
raise TypeError(msg)
return func(self, *args, **kwargs)
Expand Down

0 comments on commit cac7fba

Please sign in to comment.