diff --git a/pandas/core/dtypes/common.py b/pandas/core/dtypes/common.py index 4a0bf67f47bae..b8cbb41501dd1 100644 --- a/pandas/core/dtypes/common.py +++ b/pandas/core/dtypes/common.py @@ -2016,7 +2016,9 @@ def pandas_dtype(dtype): # also catch some valid dtypes such as object, np.object_ and 'object' # which we safeguard against by catching them earlier and returning # np.dtype(valid_dtype) before this condition is evaluated. - if dtype in [object, np.object_, 'object', 'O']: + if is_hashable(dtype) and dtype in [object, np.object_, 'object', 'O']: + # check hashability to avoid errors/DeprecationWarning when we get + # here and `dtype` is an array return npdtype elif npdtype.kind == 'O': raise TypeError("dtype '{}' not understood".format(dtype))