Skip to content

Commit 309e562

Browse files
committed
Final doc fixups
1 parent c4e548c commit 309e562

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

doc/source/categorical.rst

+4-2
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,10 @@ All instances of ``CategoricalDtype`` compare equal to the string ``'category'``
207207
.. warning::
208208

209209
Since ``dtype='category'`` is essentially ``CategoricalDtype(None, False)``,
210-
and since all instances ``CategoricalDtype`` compare equal to ``'`category'``,
211-
all instances of ``CategoricalDtype`` compare equal to a ``CategoricalDtype(None)``
210+
and since all instances ``CategoricalDtype`` compare equal to ``'category'``,
211+
all instances of ``CategoricalDtype`` compare equal to a
212+
``CategoricalDtype(None, False)``, regardless of ``categories`` or
213+
``ordered``.
212214

213215
Description
214216
-----------

doc/source/whatsnew/v0.21.0.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ Setting a list-like data structure into a new attribute now raise a ``UserWarnin
100100
expanded to include the ``categories`` and ``ordered`` attributes. A
101101
``CategoricalDtype`` can be used to specify the set of categories and
102102
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`, :issue:`15078`):
103+
e.g., when converting string data to a ``Categorical`` (:issue:`14711`,
104+
:issue:`15078`, :issue:`16015`):
104105

105106
.. ipython:: python
106107

pandas/tests/test_categorical.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def test_is_equal_dtype(self):
199199
assert not c1.is_dtype_equal(c1.astype(object))
200200
assert c1.is_dtype_equal(CategoricalIndex(c1))
201201
assert (c1.is_dtype_equal(
202-
CategoricalIndex(c1, categories=list('cab')))) # XXX: changed
202+
CategoricalIndex(c1, categories=list('cab'))))
203203
assert not c1.is_dtype_equal(CategoricalIndex(c1, ordered=True))
204204

205205
def test_constructor(self):
@@ -4250,7 +4250,7 @@ def test_categorical_index_preserver(self):
42504250

42514251
# wrong catgories
42524252
df3 = DataFrame({'A': a,
4253-
'B': pd.Categorical(b, categories=list('abe')) # XXX
4253+
'B': pd.Categorical(b, categories=list('abe'))
42544254
}).set_index('B')
42554255
pytest.raises(TypeError, lambda: pd.concat([df2, df3]))
42564256

0 commit comments

Comments
 (0)