Skip to content

Commit a847c13

Browse files
committed
undo categorical.rst
1 parent 86facac commit a847c13

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

doc/source/user_guide/categorical.rst

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,6 @@ expects a ``dtype``. For example :func:`pandas.read_csv`,
240240
array. In other words, ``dtype='category'`` is equivalent to
241241
``dtype=CategoricalDtype()``.
242242

243-
.. _categorical.equalitysemantics:
244-
245243
Equality semantics
246244
~~~~~~~~~~~~~~~~~~
247245

@@ -1180,17 +1178,3 @@ Use ``copy=True`` to prevent such a behaviour or simply don't reuse ``Categorica
11801178
This also happens in some cases when you supply a NumPy array instead of a ``Categorical``:
11811179
using an int array (e.g. ``np.array([1,2,3,4])``) will exhibit the same behavior, while using
11821180
a string array (e.g. ``np.array(["a","b","c","a"])``) will not.
1183-
1184-
Counting CategoricalDtype
1185-
~~~~~~~~~~~~~~~~~~~~~~~~~
1186-
1187-
As mentioned in :ref:`Equality Semantics <categorical.equalitysemantics>`, two instances of :class:`~pandas.api.types.CategoricalDtype` compare equal
1188-
whenever they have the same categories and order. Therefore, when counting data types, the multiple instances of :class:`~pandas.api.types.CategoricalDtype` will be counted as one group if they have the same categories and order.
1189-
In the example below, even though ``a``, ``c``, and ``d`` all have data types of ``category``, they will not be counted as one group since they don't have the same categories.
1190-
1191-
.. ipython:: python
1192-
1193-
df = pd.DataFrame({'a': [1], 'b': ['2'], 'c': [3], 'd': [3]}).astype({'a': 'category', 'c': 'category', 'd': 'category'})
1194-
df
1195-
df.dtypes
1196-
df.dtypes.value_counts()

0 commit comments

Comments
 (0)