@@ -928,13 +928,14 @@ def _find_common_type(types): |
|
|
928 |
928 |
if all(is_timedelta64_dtype(t) for t in types): |
929 |
929 |
return np.dtype('timedelta64[ns]') |
930 |
930 |
|
931 |
|
-# don't mix bool / int or float |
932 |
|
-# this is different from numpy, which casts bool/int as int |
|
931 |
+# don't mix bool / int or float or complex |
|
932 |
+# this is different from numpy, which casts bool with float/int as int |
933 |
933 |
has_bools = any(is_bool_dtype(t) for t in types) |
934 |
|
-has_ints = any(is_integer_dtype(t) for t in types) |
935 |
|
-has_floats = any(is_float_dtype(t) for t in types) |
936 |
|
-has_complex = any(is_complex_dtype(t) for t in types) |
937 |
|
-if has_bools and (has_ints or has_floats or has_complex): |
938 |
|
-return np.object |
|
934 |
+if has_bools: |
|
935 |
+has_ints = any(is_integer_dtype(t) for t in types) |
|
936 |
+has_floats = any(is_float_dtype(t) for t in types) |
|
937 |
+has_complex = any(is_complex_dtype(t) for t in types) |
|
938 |
+if has_ints or has_floats or has_complex: |
|
939 |
+return np.object |
939 |
940 |
|
940 |
941 |
return np.find_common_type(types, []) |