Skip to content

Commit b09e39a

Browse files
author
David Stephens
committed
BUG: Fix Yahoo Splits for change in format
1 parent cbdd55d commit b09e39a

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

docs/source/whatsnew.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ What's New
1818

1919
These are new features and improvements of note in each release.
2020

21+
.. include:: whatsnew/v0.9.0.txt
2122
.. include:: whatsnew/v0.8.0.txt
2223
.. include:: whatsnew/v0.7.0.txt
2324
.. include:: whatsnew/v0.6.0.txt

docs/source/whatsnew/v0.9.0.txt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
.. _whatsnew_090:
2+
3+
v0.9.0 (TBD)
4+
---------------------------
5+
6+
Highlights include:
7+
8+
9+
.. contents:: What's new in v0.9.0
10+
:local:
11+
:backlinks: none
12+
13+
14+
.. _whatsnew_090.enhancements:
15+
16+
Enhancements
17+
~~~~~~~~~~~~
18+
19+
20+
.. _whatsnew_090.api_breaking:
21+
22+
Backwards incompatible API changes
23+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24+
25+
26+
.. _whatsnew_090.bug_fixes:
27+
28+
Bug Fixes
29+
~~~~~~~~~
30+
31+
- Fix Yahoo! actions bug due to change in split format. (:issue: `755`)
32+
33+
Contributors
34+
~~~~~~~~~~~~
35+
- David Stephens

pandas_datareader/yahoo/daily.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,11 @@ def _read_one_data(self, url, params):
198198

199199
def split_ratio(row):
200200
if float(row["Numerator"]) > 0:
201-
return eval(row["Splitratio"])
201+
if ":" in row["Splitratio"]:
202+
n, m = row["Splitratio"].split(':')
203+
return float(m) / float(n)
204+
else:
205+
return eval(row["Splitratio"])
202206
else:
203207
return 1
204208

0 commit comments

Comments
 (0)