@@ -159,7 +159,7 @@ def test_get_data_null_as_missing_data(self, adj_pr):
159
159
else :
160
160
floats .append ("Adj Close" )
161
161
162
- assert result [floats ].dtypes .all () == np .floating
162
+ assert result [floats ].dtypes .all () == np .float64
163
163
164
164
@skip_on_exception (RemoteDataError )
165
165
def test_get_data_multiple_symbols_two_dates (self ):
@@ -168,7 +168,7 @@ def test_get_data_multiple_symbols_two_dates(self):
168
168
assert result .size == 3
169
169
170
170
# sanity checking
171
- assert result .dtypes == np .floating
171
+ assert result .dtypes == np .float64
172
172
173
173
expected = np .array (
174
174
[
@@ -207,12 +207,12 @@ def test_get_data_yahoo_actions(self):
207
207
assert actions .loc ["2005-02-28" , "value" ][0 ] == 1 / 2.0
208
208
209
209
assert actions .loc ["1995-11-21" , "action" ][0 ] == "DIVIDEND"
210
- assert round (actions .loc ["1995-11-21" , "value" ][0 ], 3 ) == 0.120
210
+ assert round (actions .loc ["1995-11-21" , "value" ][0 ], 3 ) == 0.030
211
211
212
212
actions = web .get_data_yahoo_actions ("AAPL" , start , end , adjust_dividends = True )
213
213
214
214
assert actions .loc ["1995-11-21" , "action" ][0 ] == "DIVIDEND"
215
- assert round (actions .loc ["1995-11-21" , "value" ][0 ], 4 ) == 0.0043
215
+ assert round (actions .loc ["1995-11-21" , "value" ][0 ], 4 ) == 0.0011
216
216
217
217
def test_get_data_yahoo_actions_invalid_symbol (self ):
218
218
start = datetime (1990 , 1 , 1 )
@@ -226,14 +226,14 @@ def test_yahoo_reader_class(self):
226
226
r = YahooDailyReader ("GOOG" , start = "JAN-01-2015" )
227
227
df = r .read ()
228
228
229
- assert df .Volume .loc ["JAN-02-2015" ] == 1447500
229
+ assert df .Volume .loc ["JAN-02-2015" ] == 1447563
230
230
231
231
session = requests .Session ()
232
232
233
233
r = YahooDailyReader ("GOOG" , session = session )
234
234
assert r .session is session
235
235
236
- def test_yahoo_DataReader (self ):
236
+ def test_yahoo_datareader (self ):
237
237
start = datetime (2010 , 1 , 1 )
238
238
end = datetime (2015 , 5 , 9 )
239
239
# yahoo will adjust for dividends by default
@@ -275,19 +275,19 @@ def test_yahoo_DataReader(self):
275
275
"DIVIDEND" ,
276
276
],
277
277
"value" : [
278
- 0.52 ,
279
- 0.47 ,
280
- 0.47 ,
281
- 0.47 ,
282
- 0.14285714 ,
283
- 0.47 ,
284
- 0.43571 ,
285
- 0.43571 ,
286
- 0.43571 ,
287
- 0.43571 ,
288
- 0.37857 ,
289
- 0.37857 ,
290
- 0.37857 ,
278
+ 0.130000 ,
279
+ 0.117500 ,
280
+ 0.117500 ,
281
+ 0.117500 ,
282
+ 0.142857 ,
283
+ 0.117500 ,
284
+ 0.108929 ,
285
+ 0.108929 ,
286
+ 0.108929 ,
287
+ 0.108929 ,
288
+ 0.094643 ,
289
+ 0.094643 ,
290
+ 0.094643 ,
291
291
],
292
292
},
293
293
index = exp_idx ,
@@ -316,19 +316,19 @@ def test_yahoo_DataReader(self):
316
316
"DIVIDEND" ,
317
317
],
318
318
"value" : [
319
- 0.52 ,
320
- 0.47 ,
321
- 0.47 ,
322
- 0.47 ,
323
- 0.14285714 ,
324
- 3.29 ,
325
- 3.05 ,
326
- 3.05 ,
327
- 3.05 ,
328
- 3.05 ,
329
- 2.65 ,
330
- 2.65 ,
331
- 2.65 ,
319
+ 0.1300 ,
320
+ 0.1175 ,
321
+ 0.1175 ,
322
+ 0.1175 ,
323
+ 0.1429 ,
324
+ 0.8225 ,
325
+ 0.7625 ,
326
+ 0.7625 ,
327
+ 0.7625 ,
328
+ 0.7625 ,
329
+ 0.6625 ,
330
+ 0.6625 ,
331
+ 0.6625 ,
332
332
],
333
333
},
334
334
index = exp_idx ,
@@ -344,13 +344,13 @@ def test_yahoo_DataReader(self):
344
344
result = web .DataReader ("NTR" , "yahoo-actions" , start , end )
345
345
346
346
exp_idx = pd .DatetimeIndex (
347
- ["2018-12-28" , "2018-09-27" , "2018-06-28" , "2018-03-28" , "2018-01-02" ]
347
+ ["2018-12-28" , "2018-09-27" , "2018-06-28" , "2018-03-28" ]
348
348
)
349
349
350
350
exp = pd .DataFrame (
351
351
{
352
- "action" : ["DIVIDEND" , "DIVIDEND" , "DIVIDEND" , "DIVIDEND" , "SPLIT" ],
353
- "value" : [0.43 , 0.40 , 0.40 , 0.40 , 1.00 ],
352
+ "action" : ["DIVIDEND" , "DIVIDEND" , "DIVIDEND" , "DIVIDEND" ],
353
+ "value" : [0.43 , 0.40 , 0.40 , 0.40 ],
354
354
},
355
355
index = exp_idx ,
356
356
)
0 commit comments