Skip to content

Commit

Permalink
Add asv test that exercises code, update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
erikoveson committed Nov 29, 2018
1 parent 325be92 commit 9e270e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions asv_bench/benchmarks/categoricals.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def setup(self):
self.values_all_nan = [np.nan] * len(self.values)
self.values_all_int8 = np.ones(N, 'int8')
self.categorical = pd.Categorical(self.values, self.categories)
self.series = pd.Series(self.categorical)

def time_regular(self):
pd.Categorical(self.values, self.categories)
Expand All @@ -72,6 +73,9 @@ def time_from_codes_all_int8(self):
def time_existing_categorical(self):
pd.Categorical(self.categorical)

def time_existing_series(self):
pd.Categorical(self.series)


class ValueCounts(object):

Expand Down
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v0.24.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ Performance Improvements
- Improved performance of :func:`pd.concat` for `Series` objects (:issue:`23404`)
- Improved performance of :meth:`DatetimeIndex.normalize` and :meth:`Timestamp.normalize` for timezone naive or UTC datetimes (:issue:`23634`)
- Improved performance of :meth:`DatetimeIndex.tz_localize` and various ``DatetimeIndex`` attributes with dateutil UTC timezone (:issue:`23772`)
- Improved performance of :meth:`Categorical.__init__` (:issue:`23814`)
- Improved performance of :class:`Categorical` constructor for `Series` objects (:issue:`23814`)

.. _whatsnew_0240.docs:

Expand Down

0 comments on commit 9e270e9

Please sign in to comment.