diff --git a/asv_bench/benchmarks/categoricals.py b/asv_bench/benchmarks/categoricals.py index 790157497ca36..f1afca5941fe5 100644 --- a/asv_bench/benchmarks/categoricals.py +++ b/asv_bench/benchmarks/categoricals.py @@ -1,5 +1,3 @@ -import warnings - import numpy as np import pandas as pd import pandas.util.testing as tm @@ -133,15 +131,10 @@ def setup(self): self.s_str = pd.Series(tm.makeCategoricalIndex(N, ncats)).astype(str) self.s_str_cat = self.s_str.astype('category') - with warnings.catch_warnings(record=True): - self.s_str_cat_ordered = self.s_str.astype('category', - ordered=True) - + self.s_str_cat_ordered = self.s_str_cat.cat.as_ordered() self.s_int = pd.Series(np.random.randint(0, ncats, size=N)) self.s_int_cat = self.s_int.astype('category') - with warnings.catch_warnings(record=True): - self.s_int_cat_ordered = self.s_int.astype('category', - ordered=True) + self.s_int_cat_ordered = self.s_int_cat.cat.as_ordered() def time_rank_string(self): self.s_str.rank()