Skip to content

Commit c8aea2c

Browse files
authored
ERR: Better error message for MultiIndex.astype (#37016)
1 parent 846cff9 commit c8aea2c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/core/indexes/multi.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3606,8 +3606,8 @@ def astype(self, dtype, copy=True):
36063606
raise NotImplementedError(msg)
36073607
elif not is_object_dtype(dtype):
36083608
raise TypeError(
3609-
f"Setting {type(self)} dtype to anything other "
3610-
"than object is not supported"
3609+
"Setting a MultiIndex dtype to anything other than object "
3610+
"is not supported"
36113611
)
36123612
elif copy is True:
36133613
return self._shallow_copy()

0 commit comments

Comments
 (0)