File tree 3 files changed +8
-5
lines changed
3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -207,8 +207,10 @@ All instances of ``CategoricalDtype`` compare equal to the string ``'category'``
207
207
.. warning ::
208
208
209
209
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 ``.
212
214
213
215
Description
214
216
-----------
Original file line number Diff line number Diff line change @@ -100,7 +100,8 @@ Setting a list-like data structure into a new attribute now raise a ``UserWarnin
100
100
expanded to include the ``categories`` and ``ordered`` attributes. A
101
101
``CategoricalDtype`` can be used to specify the set of categories and
102
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`, :issue:`15078`):
103
+ e.g., when converting string data to a ``Categorical`` (:issue:`14711`,
104
+ :issue:`15078`, :issue:`16015`):
104
105
105
106
.. ipython:: python
106
107
Original file line number Diff line number Diff line change @@ -199,7 +199,7 @@ def test_is_equal_dtype(self):
199
199
assert not c1 .is_dtype_equal (c1 .astype (object ))
200
200
assert c1 .is_dtype_equal (CategoricalIndex (c1 ))
201
201
assert (c1 .is_dtype_equal (
202
- CategoricalIndex (c1 , categories = list ('cab' )))) # XXX: changed
202
+ CategoricalIndex (c1 , categories = list ('cab' ))))
203
203
assert not c1 .is_dtype_equal (CategoricalIndex (c1 , ordered = True ))
204
204
205
205
def test_constructor (self ):
@@ -4250,7 +4250,7 @@ def test_categorical_index_preserver(self):
4250
4250
4251
4251
# wrong catgories
4252
4252
df3 = DataFrame ({'A' : a ,
4253
- 'B' : pd .Categorical (b , categories = list ('abe' )) # XXX
4253
+ 'B' : pd .Categorical (b , categories = list ('abe' ))
4254
4254
}).set_index ('B' )
4255
4255
pytest .raises (TypeError , lambda : pd .concat ([df2 , df3 ]))
4256
4256
You can’t perform that action at this time.
0 commit comments