diff --git a/pandas/core/indexes/multi.py b/pandas/core/indexes/multi.py index 0604f70316cfb..9942ac35b1c8c 100644 --- a/pandas/core/indexes/multi.py +++ b/pandas/core/indexes/multi.py @@ -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()