Skip to content

Commit 1f553e2

Browse files
author
analyticalmonk
committed
BUG: Added 'list' to pandas_dtype() valid dtype list
1 parent f91586f commit 1f553e2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pandas/core/dtypes/common.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ def pandas_dtype(dtype):
745745
np.dtype(dtype)
746746
except (TypeError, ValueError):
747747
raise
748-
if dtype in [object, np.object_]:
748+
if dtype in [object, np.object_, list]:
749749
return np.dtype(dtype)
750750
elif np.dtype(dtype).kind == 'O':
751751
raise TypeError('dtype {0} not understood'.format(dtype))

pandas/tests/dtypes/test_common.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def test_invalid_dtype_error(self):
2222
with tm.assertRaisesRegexp(TypeError, msg):
2323
pandas_dtype(dtype)
2424

25-
valid_list = [object, 'float64', np.object_,
25+
valid_list = [object, 'float64', np.object_, list,
2626
np.float64, float, np.dtype('float64')]
2727
for dtype in valid_list:
2828
pandas_dtype(dtype)

0 commit comments

Comments
 (0)