@@ -96,14 +96,42 @@ def time_average_old(self, constructor, pct):
96
96
97
97
class Correlation (object ):
98
98
99
- params = ['spearman' , 'kendall' , 'pearson' ]
100
- param_names = ['method' ]
99
+ params = [[ 'spearman' , 'kendall' , 'pearson' ], [ True , False ] ]
100
+ param_names = ['method' , 'use_bottleneck' ]
101
101
102
- def setup (self , method ):
102
+ def setup (self , method , use_bottleneck ):
103
+ try :
104
+ pd .options .compute .use_bottleneck = use_bottleneck
105
+ except TypeError :
106
+ from pandas .core import nanops
107
+ nanops ._USE_BOTTLENECK = use_bottleneck
103
108
self .df = pd .DataFrame (np .random .randn (1000 , 30 ))
109
+ self .s = pd .Series (np .random .randn (1000 ))
110
+ self .s2 = pd .Series (np .random .randn (1000 ))
104
111
105
- def time_corr (self , method ):
112
+ def time_corr (self , method , use_bottleneck ):
106
113
self .df .corr (method = method )
107
114
115
+ def time_corr_series (self , method , use_bottleneck ):
116
+ self .s .corr (self .s2 , method = method )
117
+
118
+
119
+ class Covariance (object ):
120
+
121
+ params = [[True , False ]]
122
+ param_names = ['use_bottleneck' ]
123
+
124
+ def setup (self , use_bottleneck ):
125
+ try :
126
+ pd .options .compute .use_bottleneck = use_bottleneck
127
+ except TypeError :
128
+ from pandas .core import nanops
129
+ nanops ._USE_BOTTLENECK = use_bottleneck
130
+ self .s = pd .Series (np .random .randn (100000 ))
131
+ self .s2 = pd .Series (np .random .randn (100000 ))
132
+
133
+ def time_cov_series (self , use_bottleneck ):
134
+ self .s .cov (self .s2 )
135
+
108
136
109
137
from .pandas_vb_common import setup # noqa: F401
0 commit comments