@@ -20,6 +20,40 @@ def setup(self, constructor, window, dtype, method):
20
20
def time_rolling (self , constructor , window , dtype , method ):
21
21
getattr (self .roll , method )()
22
22
23
+ class ExpandingMethods (object ):
24
+
25
+ sample_time = 0.2
26
+ params = (['DataFrame' , 'Series' ],
27
+ ['int' , 'float' ],
28
+ ['median' , 'mean' , 'max' , 'min' , 'std' , 'count' , 'skew' , 'kurt' ,
29
+ 'sum' ])
30
+ param_names = ['contructor' , 'window' , 'dtype' , 'method' ]
31
+
32
+ def setup (self , constructor , dtype , method ):
33
+ N = 10 ** 5
34
+ arr = (100 * np .random .random (N )).astype (dtype )
35
+ self .expanding = getattr (pd , constructor )(arr ).expanding ()
36
+
37
+ def time_expanding (self , constructor , dtype , method ):
38
+ getattr (self .expanding , method )()
39
+
40
+ class EWMMethods (object ):
41
+
42
+ sample_time = 0.2
43
+ params = (['DataFrame' , 'Series' ],
44
+ [10 , 1000 ],
45
+ ['int' , 'float' ],
46
+ ['mean' , 'std' ])
47
+ param_names = ['contructor' , 'window' , 'dtype' , 'method' ]
48
+
49
+ def setup (self , constructor , window , dtype , method ):
50
+ N = 10 ** 5
51
+ arr = (100 * np .random .random (N )).astype (dtype )
52
+ self .ewm = getattr (pd , constructor )(arr ).ewm (halflife = window )
53
+
54
+ def time_ewm (self , constructor , window , dtype , method ):
55
+ getattr (self .ewm , method )()
56
+
23
57
24
58
class VariableWindowMethods (Methods ):
25
59
sample_time = 0.2
0 commit comments