We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a1d451f commit e851c6bCopy full SHA for e851c6b
pandas/core/dtypes/common.py
@@ -2016,7 +2016,9 @@ def pandas_dtype(dtype):
2016
# also catch some valid dtypes such as object, np.object_ and 'object'
2017
# which we safeguard against by catching them earlier and returning
2018
# np.dtype(valid_dtype) before this condition is evaluated.
2019
- if dtype in [object, np.object_, 'object', 'O']:
+ if is_hashable(dtype) and dtype in [object, np.object_, 'object', 'O']:
2020
+ # check hashability to avoid errors/DeprecationWarning when we get
2021
+ # here and `dtype` is an array
2022
return npdtype
2023
elif npdtype.kind == 'O':
2024
raise TypeError("dtype '{}' not understood".format(dtype))
0 commit comments