@@ -17,38 +17,48 @@ class Factorize(object):
17
17
18
18
goal_time = 0.2
19
19
20
- def setup (self ):
20
+ params = [True , False ]
21
+ param_names = ['sort' ]
22
+
23
+ def setup (self , sort ):
21
24
N = 10 ** 5
22
25
np .random .seed (1234 )
23
26
self .int_idx = pd .Int64Index (np .arange (N ).repeat (5 ))
24
27
self .float_idx = pd .Float64Index (np .random .randn (N ).repeat (5 ))
25
28
self .string_idx = tm .makeStringIndex (N )
26
29
27
- def time_factorize_int (self ):
28
- self .int_idx .factorize ()
30
+ def time_factorize_int (self , sort ):
31
+ self .int_idx .factorize (sort = sort )
29
32
30
- def time_factorize_float (self ):
31
- self .float_idx .factorize ()
33
+ def time_factorize_float (self , sort ):
34
+ self .float_idx .factorize (sort = sort )
32
35
33
- def time_factorize_string (self ):
34
- self .string_idx .factorize ()
36
+ def time_factorize_string (self , sort ):
37
+ self .string_idx .factorize (sort = sort )
35
38
36
39
37
40
class Duplicated (object ):
38
41
39
42
goal_time = 0.2
40
43
41
- def setup (self ):
44
+ params = ['first' , 'last' , False ]
45
+ param_names = ['keep' ]
46
+
47
+ def setup (self , keep ):
42
48
N = 10 ** 5
43
49
np .random .seed (1234 )
44
50
self .int_idx = pd .Int64Index (np .arange (N ).repeat (5 ))
45
51
self .float_idx = pd .Float64Index (np .random .randn (N ).repeat (5 ))
52
+ self .string_idx = tm .makeStringIndex (N )
53
+
54
+ def time_duplicated_int (self , keep ):
55
+ self .int_idx .duplicated (keep = keep )
46
56
47
- def time_duplicated_int (self ):
48
- self .int_idx .duplicated ()
57
+ def time_duplicated_float (self , keep ):
58
+ self .float_idx .duplicated (keep = keep )
49
59
50
- def time_duplicated_float (self ):
51
- self .float_idx .duplicated ()
60
+ def time_duplicated_string (self , keep ):
61
+ self .string_idx .duplicated (keep = keep )
52
62
53
63
54
64
class DuplicatedUniqueIndex (object ):
0 commit comments