File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1213,6 +1213,7 @@ Performance Improvements
12131213 The speed increase is both when indexing by label (using .loc) and position(.iloc) (:issue: `20395 `)
12141214 Slicing a monotonically increasing :class: `CategoricalIndex ` itself (i.e. ``ci[1000:2000] ``)
12151215 shows similar speed improvements as above (:issue: `21659 `)
1216+ - Improved performance of :meth: `CategoricalIndex.equals ` when comparing to another :class: `CategoricalIndex ` (:issue: `24023 `)
12161217- Improved performance of :func: `Series.describe ` in case of numeric dtpyes (:issue: `21274 `)
12171218- Improved performance of :func: `pandas.core.groupby.GroupBy.rank ` when dealing with tied rankings (:issue: `21237 `)
12181219- Improved performance of :func: `DataFrame.set_index ` with columns consisting of :class: `Period ` objects (:issue: `21582 `, :issue: `21606 `)
Original file line number Diff line number Diff line change 1313 is_scalar )
1414from pandas .core .dtypes .dtypes import CategoricalDtype
1515from pandas .core .dtypes .generic import ABCCategorical , ABCSeries
16- from pandas .core .dtypes .missing import array_equivalent , isna
16+ from pandas .core .dtypes .missing import isna
1717
1818from pandas .core import accessor
1919from pandas .core .algorithms import take_1d
@@ -283,7 +283,9 @@ def equals(self, other):
283283
284284 try :
285285 other = self ._is_dtype_compat (other )
286- return array_equivalent (self ._data , other )
286+ if isinstance (other , type (self )):
287+ other = other ._data
288+ return self ._data .equals (other )
287289 except (TypeError , ValueError ):
288290 pass
289291
You can’t perform that action at this time.
0 commit comments