@@ -146,4 +146,42 @@ def time_get_dummies_1d_sparse(self):
146
146
pd .get_dummies (self .s , sparse = True )
147
147
148
148
149
+ class Cut (object ):
150
+ params = [[4 , 10 , 1000 ]]
151
+ param_names = ['bins' ]
152
+
153
+ def setup (self , bins ):
154
+ N = 10 ** 5
155
+ self .int_series = pd .Series (np .arange (N ).repeat (5 ))
156
+ self .float_series = pd .Series (np .random .randn (N ).repeat (5 ))
157
+ self .timedelta_series = pd .Series (np .random .randint (N , size = N ),
158
+ dtype = 'timedelta64[ns]' )
159
+ self .datetime_series = pd .Series (np .random .randint (N , size = N ),
160
+ dtype = 'datetime64[ns]' )
161
+
162
+ def time_cut_int (self , bins ):
163
+ pd .cut (self .int_series , bins )
164
+
165
+ def time_cut_float (self , bins ):
166
+ pd .cut (self .float_series , bins )
167
+
168
+ def time_cut_timedelta (self , bins ):
169
+ pd .cut (self .timedelta_series , bins )
170
+
171
+ def time_cut_datetime (self , bins ):
172
+ pd .cut (self .datetime_series , bins )
173
+
174
+ def time_qcut_int (self , bins ):
175
+ pd .qcut (self .int_series , bins )
176
+
177
+ def time_qcut_float (self , bins ):
178
+ pd .qcut (self .float_series , bins )
179
+
180
+ def time_qcut_timedelta (self , bins ):
181
+ pd .qcut (self .timedelta_series , bins )
182
+
183
+ def time_qcut_datetime (self , bins ):
184
+ pd .qcut (self .datetime_series , bins )
185
+
186
+
149
187
from .pandas_vb_common import setup # noqa: F401
0 commit comments