File tree 1 file changed +2
-9
lines changed
1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change 1
- import warnings
2
-
3
1
import numpy as np
4
2
import pandas as pd
5
3
import pandas .util .testing as tm
@@ -133,15 +131,10 @@ def setup(self):
133
131
134
132
self .s_str = pd .Series (tm .makeCategoricalIndex (N , ncats )).astype (str )
135
133
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 ()
140
135
self .s_int = pd .Series (np .random .randint (0 , ncats , size = N ))
141
136
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 ()
145
138
146
139
def time_rank_string (self ):
147
140
self .s_str .rank ()
You can’t perform that action at this time.
0 commit comments