Skip to content

Commit 9e270e9

Browse files
committed
Add asv test that exercises code, update docs
1 parent 325be92 commit 9e270e9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

asv_bench/benchmarks/categoricals.py

+4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def setup(self):
4747
self.values_all_nan = [np.nan] * len(self.values)
4848
self.values_all_int8 = np.ones(N, 'int8')
4949
self.categorical = pd.Categorical(self.values, self.categories)
50+
self.series = pd.Series(self.categorical)
5051

5152
def time_regular(self):
5253
pd.Categorical(self.values, self.categories)
@@ -72,6 +73,9 @@ def time_from_codes_all_int8(self):
7273
def time_existing_categorical(self):
7374
pd.Categorical(self.categorical)
7475

76+
def time_existing_series(self):
77+
pd.Categorical(self.series)
78+
7579

7680
class ValueCounts(object):
7781

doc/source/whatsnew/v0.24.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1150,7 +1150,7 @@ Performance Improvements
11501150
- Improved performance of :func:`pd.concat` for `Series` objects (:issue:`23404`)
11511151
- Improved performance of :meth:`DatetimeIndex.normalize` and :meth:`Timestamp.normalize` for timezone naive or UTC datetimes (:issue:`23634`)
11521152
- Improved performance of :meth:`DatetimeIndex.tz_localize` and various ``DatetimeIndex`` attributes with dateutil UTC timezone (:issue:`23772`)
1153-
- Improved performance of :meth:`Categorical.__init__` (:issue:`23814`)
1153+
- Improved performance of :class:`Categorical` constructor for `Series` objects (:issue:`23814`)
11541154

11551155
.. _whatsnew_0240.docs:
11561156

0 commit comments

Comments
 (0)