Skip to content

Commit 367a9e6

Browse files
author
David Stephens
committed
BUG: Fix dividend adjustment
1 parent aec5875 commit 367a9e6

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

docs/source/whatsnew/v0.8.0.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
.. _whatsnew_080:
2+
3+
v0.8.0 (TBD)
4+
---------------------------
5+
6+
Highlights include:
7+
8+
.. contents:: What's new in v0.8.0
9+
:local:
10+
:backlinks: none
11+
12+
.. _whatsnew_080.enhancements:
13+
14+
Enhancements
15+
~~~~~~~~~~~~
16+
17+
18+
.. _whatsnew_080.api_breaking:
19+
20+
Backwards incompatible API changes
21+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22+
23+
24+
25+
.. _whatsnew_080.bug_fixes:
26+
27+
Bug Fixes
28+
~~~~~~~~~
29+
30+
- Fix Yahoo! actions issue where dividends are adjusted twice as a result of a
31+
change to the Yahoo! API. (:issue: `583`)

pandas_datareader/yahoo/daily.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,10 @@ def _read_one_data(self, url, params):
181181
splits['Splits'] = 1.0 / splits['SplitRatio']
182182
prices = prices.join(splits['Splits'], how='outer')
183183

184-
if 'DIVIDEND' in types and not self.adjust_dividends:
184+
if 'DIVIDEND' in types and self.adjust_dividends:
185185
# Adjust dividends to deal with splits
186186
adj = prices['Splits'].sort_index(ascending=False).fillna(
187187
1).cumprod()
188-
adj = 1.0 / adj
189188
prices['Dividends'] = prices['Dividends'] * adj
190189

191190
return prices

0 commit comments

Comments
 (0)