You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The values have been correctly interpreted as integers.
152
+
132
153
The ``.dtype`` property of a ``Categorical``, ``CategoricalIndex`` or a
133
154
``Series`` with categorical type will now return an instance of ``CategoricalDtype``.
155
+
For the most part, this is backwards compatible, though the string repr has changed.
156
+
If you were previously using ``str(s.dtype == 'category')`` to detect categorical data,
157
+
switch to :func:`api.types.is_categorical_dtype`, which is compatible with the old and
158
+
new ``CategoricalDtype``.
134
159
135
160
See the :ref:`CategoricalDtype docs <categorical.categoricaldtype>` for more.
136
161
@@ -163,8 +188,6 @@ Other Enhancements
163
188
- :func:`Categorical.rename_categories` now accepts a dict-like argument as `new_categories` and only updates the categories found in that dict. (:issue:`17336`)
164
189
- :func:`read_excel` raises ``ImportError`` with a better message if ``xlrd`` is not installed. (:issue:`17613`)
165
190
- :meth:`DataFrame.assign` will preserve the original order of ``**kwargs`` for Python 3.6+ users instead of sorting the column names
166
-
- Pass a :class:`~pandas.api.types.CategoricalDtype` to :meth:`read_csv` to parse categorical
167
-
data as numeric, datetimes, or timedeltas, instead of strings. See :ref:`here <io.categorical>`. (:issue:`17643`)
0 commit comments