Skip to content

Commit

Permalink
Merge pull request #584 from pydata/dividend_test
Browse files Browse the repository at this point in the history
BUG: Fix dividend adjustment
  • Loading branch information
bashtage committed Oct 20, 2018
2 parents 2276f59 + 367a9e6 commit 7949e60
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
31 changes: 31 additions & 0 deletions docs/source/whatsnew/v0.8.0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.. _whatsnew_080:

v0.8.0 (TBD)
---------------------------

Highlights include:

.. contents:: What's new in v0.8.0
:local:
:backlinks: none

.. _whatsnew_080.enhancements:

Enhancements
~~~~~~~~~~~~


.. _whatsnew_080.api_breaking:

Backwards incompatible API changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



.. _whatsnew_080.bug_fixes:

Bug Fixes
~~~~~~~~~

- Fix Yahoo! actions issue where dividends are adjusted twice as a result of a
change to the Yahoo! API. (:issue: `583`)
3 changes: 1 addition & 2 deletions pandas_datareader/yahoo/daily.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,10 @@ def _read_one_data(self, url, params):
splits['Splits'] = 1.0 / splits['SplitRatio']
prices = prices.join(splits['Splits'], how='outer')

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

return prices
Expand Down

0 comments on commit 7949e60

Please sign in to comment.