|
9 | 9 | from pandas.compat import PY3, string_types, text_type, to_str
|
10 | 10 |
|
11 | 11 | from .common import (
|
12 |
| - _INT64_DTYPE, _NS_DTYPE, _POSSIBLY_CAST_DTYPES, _TD_DTYPE, _string_dtypes, |
13 |
| - ensure_int8, ensure_int16, ensure_int32, ensure_int64, ensure_object, |
14 |
| - is_bool, is_bool_dtype, is_categorical_dtype, is_complex, is_complex_dtype, |
| 12 | + _INT64_DTYPE, _NS_DTYPE, _POSSIBLY_CAST_DTYPES, _TD_DTYPE, ensure_int8, |
| 13 | + ensure_int16, ensure_int32, ensure_int64, ensure_object, is_bool, |
| 14 | + is_bool_dtype, is_categorical_dtype, is_complex, is_complex_dtype, |
15 | 15 | is_datetime64_dtype, is_datetime64_ns_dtype, is_datetime64tz_dtype,
|
16 | 16 | is_datetime_or_timedelta_dtype, is_datetimelike, is_dtype_equal,
|
17 | 17 | is_extension_array_dtype, is_extension_type, is_float, is_float_dtype,
|
@@ -544,7 +544,7 @@ def invalidate_string_dtypes(dtype_set):
|
544 | 544 | """Change string like dtypes to object for
|
545 | 545 | ``DataFrame.select_dtypes()``.
|
546 | 546 | """
|
547 |
| - non_string_dtypes = dtype_set - _string_dtypes |
| 547 | + non_string_dtypes = dtype_set - {np.dtype('S').type, np.dtype('<U').type} |
548 | 548 | if non_string_dtypes != dtype_set:
|
549 | 549 | raise TypeError("string dtypes are not allowed, use 'object' instead")
|
550 | 550 |
|
|
0 commit comments