77
88class FrameOps :
99
10- params = [ops , ["float" , "int" ], [0 , 1 ], [ True , False ] ]
11- param_names = ["op" , "dtype" , "axis" , "use_bottleneck" ]
10+ params = [ops , ["float" , "int" ], [0 , 1 ]]
11+ param_names = ["op" , "dtype" , "axis" ]
1212
13- def setup (self , op , dtype , axis , use_bottleneck ):
13+ def setup (self , op , dtype , axis ):
1414 df = pd .DataFrame (np .random .randn (100000 , 4 )).astype (dtype )
15- try :
16- pd .options .compute .use_bottleneck = use_bottleneck
17- except TypeError :
18- from pandas .core import nanops
19-
20- nanops ._USE_BOTTLENECK = use_bottleneck
2115 self .df_func = getattr (df , op )
2216
23- def time_op (self , op , dtype , axis , use_bottleneck ):
17+ def time_op (self , op , dtype , axis ):
2418 self .df_func (axis = axis )
2519
2620
@@ -46,20 +40,14 @@ def time_op(self, level, op):
4640
4741class SeriesOps :
4842
49- params = [ops , ["float" , "int" ], [ True , False ] ]
50- param_names = ["op" , "dtype" , "use_bottleneck" ]
43+ params = [ops , ["float" , "int" ]]
44+ param_names = ["op" , "dtype" ]
5145
52- def setup (self , op , dtype , use_bottleneck ):
46+ def setup (self , op , dtype ):
5347 s = pd .Series (np .random .randn (100000 )).astype (dtype )
54- try :
55- pd .options .compute .use_bottleneck = use_bottleneck
56- except TypeError :
57- from pandas .core import nanops
58-
59- nanops ._USE_BOTTLENECK = use_bottleneck
6048 self .s_func = getattr (s , op )
6149
62- def time_op (self , op , dtype , use_bottleneck ):
50+ def time_op (self , op , dtype ):
6351 self .s_func ()
6452
6553
@@ -101,61 +89,49 @@ def time_average_old(self, constructor, pct):
10189
10290class Correlation :
10391
104- params = [["spearman" , "kendall" , "pearson" ], [ True , False ] ]
105- param_names = ["method" , "use_bottleneck" ]
92+ params = [["spearman" , "kendall" , "pearson" ]]
93+ param_names = ["method" ]
10694
107- def setup (self , method , use_bottleneck ):
108- try :
109- pd .options .compute .use_bottleneck = use_bottleneck
110- except TypeError :
111- from pandas .core import nanops
95+ def setup (self , method ):
96+ self .df = pd .DataFrame (np .random .randn (500 , 15 ))
97+ self .df2 = pd .DataFrame (np .random .randn (500 , 15 ))
98+ self .df_wide = pd .DataFrame (np .random .randn (500 , 100 ))
99+ self .df_wide_nans = self .df_wide .where (np .random .random ((500 , 100 )) < 0.9 )
100+ self .s = pd .Series (np .random .randn (500 ))
101+ self .s2 = pd .Series (np .random .randn (500 ))
112102
113- nanops ._USE_BOTTLENECK = use_bottleneck
114- self .df = pd .DataFrame (np .random .randn (1000 , 30 ))
115- self .df2 = pd .DataFrame (np .random .randn (1000 , 30 ))
116- self .df_wide = pd .DataFrame (np .random .randn (1000 , 200 ))
117- self .df_wide_nans = self .df_wide .where (np .random .random ((1000 , 200 )) < 0.9 )
118- self .s = pd .Series (np .random .randn (1000 ))
119- self .s2 = pd .Series (np .random .randn (1000 ))
120-
121- def time_corr (self , method , use_bottleneck ):
103+ def time_corr (self , method ):
122104 self .df .corr (method = method )
123105
124- def time_corr_wide (self , method , use_bottleneck ):
106+ def time_corr_wide (self , method ):
125107 self .df_wide .corr (method = method )
126108
127- def time_corr_wide_nans (self , method , use_bottleneck ):
109+ def time_corr_wide_nans (self , method ):
128110 self .df_wide_nans .corr (method = method )
129111
130- def peakmem_corr_wide (self , method , use_bottleneck ):
112+ def peakmem_corr_wide (self , method ):
131113 self .df_wide .corr (method = method )
132114
133- def time_corr_series (self , method , use_bottleneck ):
115+ def time_corr_series (self , method ):
134116 self .s .corr (self .s2 , method = method )
135117
136- def time_corrwith_cols (self , method , use_bottleneck ):
118+ def time_corrwith_cols (self , method ):
137119 self .df .corrwith (self .df2 , method = method )
138120
139- def time_corrwith_rows (self , method , use_bottleneck ):
121+ def time_corrwith_rows (self , method ):
140122 self .df .corrwith (self .df2 , axis = 1 , method = method )
141123
142124
143125class Covariance :
144126
145- params = [[True , False ]]
146- param_names = ["use_bottleneck" ]
147-
148- def setup (self , use_bottleneck ):
149- try :
150- pd .options .compute .use_bottleneck = use_bottleneck
151- except TypeError :
152- from pandas .core import nanops
127+ params = []
128+ param_names = []
153129
154- nanops . _USE_BOTTLENECK = use_bottleneck
130+ def setup ( self ):
155131 self .s = pd .Series (np .random .randn (100000 ))
156132 self .s2 = pd .Series (np .random .randn (100000 ))
157133
158- def time_cov_series (self , use_bottleneck ):
134+ def time_cov_series (self ):
159135 self .s .cov (self .s2 )
160136
161137
0 commit comments