Skip to content

Commit

Permalink
ERR: Better error message for MultiIndex.astype (#37016)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsaxton authored Oct 10, 2020
1 parent 846cff9 commit c8aea2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pandas/core/indexes/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -3606,8 +3606,8 @@ def astype(self, dtype, copy=True):
raise NotImplementedError(msg)
elif not is_object_dtype(dtype):
raise TypeError(
f"Setting {type(self)} dtype to anything other "
"than object is not supported"
"Setting a MultiIndex dtype to anything other than object "
"is not supported"
)
elif copy is True:
return self._shallow_copy()
Expand Down

0 comments on commit c8aea2c

Please sign in to comment.