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
Copy file name to clipboardExpand all lines: doc/source/whatsnew/v0.21.0.txt
+27
Original file line number
Original file line
Diff line number
Diff line change
@@ -10,6 +10,8 @@ users upgrade to this version.
10
Highlights include:
10
Highlights include:
11
11
12
- Integration with `Apache Parquet <https://parquet.apache.org/>`__, including a new top-level :func:`read_parquet` and :func:`DataFrame.to_parquet` method, see :ref:`here <io.parquet>`.
12
- Integration with `Apache Parquet <https://parquet.apache.org/>`__, including a new top-level :func:`read_parquet` and :func:`DataFrame.to_parquet` method, see :ref:`here <io.parquet>`.
13
+
- New user-facing :class:`pandas.api.types.CategoricalDtype` for specifying
14
+
categoricals independent of the data, see :ref:`here <whatsnew_0210.enhancements.categorical_dtype>`.
13
15
14
Check the :ref:`API Changes <whatsnew_0210.api_breaking>` and :ref:`deprecations <whatsnew_0210.deprecations>` before updating.
16
Check the :ref:`API Changes <whatsnew_0210.api_breaking>` and :ref:`deprecations <whatsnew_0210.deprecations>` before updating.
15
17
@@ -89,6 +91,31 @@ This does not raise any obvious exceptions, but also does not create a new colum
89
91
90
Setting a list-like data structure into a new attribute now raise a ``UserWarning`` about the potential for unexpected behavior. See :ref:`Attribute Access <indexing.attribute_access>`.
92
Setting a list-like data structure into a new attribute now raise a ``UserWarning`` about the potential for unexpected behavior. See :ref:`Attribute Access <indexing.attribute_access>`.
91
93
94
+
.. _whatsnew_0210.enhancements.categorical_dtype:
95
+
96
+
``CategoricalDtype`` for specifying categoricals
97
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
98
+
99
+
:class:`pandas.api.types.CategoricalDtype` has been added to the public API and
100
+
expanded to include the ``categories`` and ``ordered`` attributes. A
101
+
``CategoricalDtype`` can be used to specify the set of categories and
102
+
orderedness of an array, independent of the data themselves. This can be useful,
103
+
e.g., when converting string data to a ``Categorical`` (:issue:`14711`,
0 commit comments