@@ -84,7 +84,7 @@ class ValueCounts:
84
84
85
85
def setup (self , dropna ):
86
86
n = 5 * 10 ** 5
87
- arr = ["s{:04d}" . format ( i ) for i in np .random .randint (0 , n // 10 , size = n )]
87
+ arr = [f "s{ i :04d} " for i in np .random .randint (0 , n // 10 , size = n )]
88
88
self .ts = pd .Series (arr ).astype ("category" )
89
89
90
90
def time_value_counts (self , dropna ):
@@ -102,7 +102,7 @@ def time_rendering(self):
102
102
class SetCategories :
103
103
def setup (self ):
104
104
n = 5 * 10 ** 5
105
- arr = ["s{:04d}" . format ( i ) for i in np .random .randint (0 , n // 10 , size = n )]
105
+ arr = [f "s{ i :04d} " for i in np .random .randint (0 , n // 10 , size = n )]
106
106
self .ts = pd .Series (arr ).astype ("category" )
107
107
108
108
def time_set_categories (self ):
@@ -112,7 +112,7 @@ def time_set_categories(self):
112
112
class RemoveCategories :
113
113
def setup (self ):
114
114
n = 5 * 10 ** 5
115
- arr = ["s{:04d}" . format ( i ) for i in np .random .randint (0 , n // 10 , size = n )]
115
+ arr = [f "s{ i :04d} " for i in np .random .randint (0 , n // 10 , size = n )]
116
116
self .ts = pd .Series (arr ).astype ("category" )
117
117
118
118
def time_remove_categories (self ):
@@ -166,7 +166,7 @@ def setup(self, dtype):
166
166
sample_size = 100
167
167
arr = [i for i in np .random .randint (0 , n // 10 , size = n )]
168
168
if dtype == "object" :
169
- arr = ["s{:04d}" . format ( i ) for i in arr ]
169
+ arr = [f "s{ i :04d} " for i in arr ]
170
170
self .sample = np .random .choice (arr , sample_size )
171
171
self .series = pd .Series (arr ).astype ("category" )
172
172
@@ -225,7 +225,7 @@ def setup(self, index):
225
225
elif index == "non_monotonic" :
226
226
self .data = pd .Categorical .from_codes ([0 , 1 , 2 ] * N , categories = categories )
227
227
else :
228
- raise ValueError ("Invalid index param: {}" . format ( index ) )
228
+ raise ValueError (f "Invalid index param: { index } " )
229
229
230
230
self .scalar = 10000
231
231
self .list = list (range (10000 ))
0 commit comments