File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change 1- import warnings
2-
31import numpy as np
42import pandas as pd
53import pandas .util .testing as tm
@@ -133,15 +131,10 @@ def setup(self):
133131
134132 self .s_str = pd .Series (tm .makeCategoricalIndex (N , ncats )).astype (str )
135133 self .s_str_cat = self .s_str .astype ('category' )
136- with warnings .catch_warnings (record = True ):
137- self .s_str_cat_ordered = self .s_str .astype ('category' ,
138- ordered = True )
139-
134+ self .s_str_cat_ordered = self .s_str_cat .cat .as_ordered ()
140135 self .s_int = pd .Series (np .random .randint (0 , ncats , size = N ))
141136 self .s_int_cat = self .s_int .astype ('category' )
142- with warnings .catch_warnings (record = True ):
143- self .s_int_cat_ordered = self .s_int .astype ('category' ,
144- ordered = True )
137+ self .s_int_cat_ordered = self .s_int_cat .cat .as_ordered ()
145138
146139 def time_rank_string (self ):
147140 self .s_str .rank ()
You can’t perform that action at this time.
0 commit comments