@@ -154,35 +154,35 @@ def _check_stat_op(
154
154
f (string_series_ , numeric_only = True )
155
155
156
156
def test_sum (self ):
157
- string_series = tm . makeStringSeries (). rename ( "series" )
157
+ string_series = Series ( range ( 20 ), dtype = np . float64 , name = "series" )
158
158
self ._check_stat_op ("sum" , np .sum , string_series , check_allna = False )
159
159
160
160
def test_mean (self ):
161
- string_series = tm . makeStringSeries (). rename ( "series" )
161
+ string_series = Series ( range ( 20 ), dtype = np . float64 , name = "series" )
162
162
self ._check_stat_op ("mean" , np .mean , string_series )
163
163
164
164
def test_median (self ):
165
- string_series = tm . makeStringSeries (). rename ( "series" )
165
+ string_series = Series ( range ( 20 ), dtype = np . float64 , name = "series" )
166
166
self ._check_stat_op ("median" , np .median , string_series )
167
167
168
168
# test with integers, test failure
169
169
int_ts = Series (np .ones (10 , dtype = int ), index = range (10 ))
170
170
tm .assert_almost_equal (np .median (int_ts ), int_ts .median ())
171
171
172
172
def test_prod (self ):
173
- string_series = tm . makeStringSeries (). rename ( "series" )
173
+ string_series = Series ( range ( 20 ), dtype = np . float64 , name = "series" )
174
174
self ._check_stat_op ("prod" , np .prod , string_series )
175
175
176
176
def test_min (self ):
177
- string_series = tm . makeStringSeries (). rename ( "series" )
177
+ string_series = Series ( range ( 20 ), dtype = np . float64 , name = "series" )
178
178
self ._check_stat_op ("min" , np .min , string_series , check_objects = True )
179
179
180
180
def test_max (self ):
181
- string_series = tm . makeStringSeries (). rename ( "series" )
181
+ string_series = Series ( range ( 20 ), dtype = np . float64 , name = "series" )
182
182
self ._check_stat_op ("max" , np .max , string_series , check_objects = True )
183
183
184
184
def test_var_std (self ):
185
- string_series = tm . makeStringSeries (). rename ( "series" )
185
+ string_series = Series ( range ( 20 ), dtype = np . float64 , name = "series" )
186
186
datetime_series = tm .makeTimeSeries ().rename ("ts" )
187
187
188
188
alt = lambda x : np .std (x , ddof = 1 )
@@ -208,7 +208,7 @@ def test_var_std(self):
208
208
assert pd .isna (result )
209
209
210
210
def test_sem (self ):
211
- string_series = tm . makeStringSeries (). rename ( "series" )
211
+ string_series = Series ( range ( 20 ), dtype = np . float64 , name = "series" )
212
212
datetime_series = tm .makeTimeSeries ().rename ("ts" )
213
213
214
214
alt = lambda x : np .std (x , ddof = 1 ) / np .sqrt (len (x ))
@@ -228,7 +228,7 @@ def test_sem(self):
228
228
def test_skew (self ):
229
229
sp_stats = pytest .importorskip ("scipy.stats" )
230
230
231
- string_series = tm . makeStringSeries (). rename ( "series" )
231
+ string_series = Series ( range ( 20 ), dtype = np . float64 , name = "series" )
232
232
233
233
alt = lambda x : sp_stats .skew (x , bias = False )
234
234
self ._check_stat_op ("skew" , alt , string_series )
@@ -250,7 +250,7 @@ def test_skew(self):
250
250
def test_kurt (self ):
251
251
sp_stats = pytest .importorskip ("scipy.stats" )
252
252
253
- string_series = tm . makeStringSeries (). rename ( "series" )
253
+ string_series = Series ( range ( 20 ), dtype = np . float64 , name = "series" )
254
254
255
255
alt = lambda x : sp_stats .kurtosis (x , bias = False )
256
256
self ._check_stat_op ("kurt" , alt , string_series )
0 commit comments