Skip to content

Commit

Permalink
Merge pull request #1191 from quantopian/almost-correct
Browse files Browse the repository at this point in the history
BUG: fix inverted splits in quandl data
  • Loading branch information
llllllllll committed May 9, 2016
2 parents 10daf9e + 55f1548 commit e4934cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/data/bundles/test_quandl.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def expected_dividend_adjustment(idx, symbol):
last_row=i(108),
first_col=sids['AAPL'],
last_col=sids['AAPL'],
value=7.0,
value=1.0 / 7.0,
)],
},
] * (len(self.columns) - 1) + [
Expand All @@ -173,7 +173,7 @@ def expected_dividend_adjustment(idx, symbol):
last_row=i(108),
first_col=sids['AAPL'],
last_col=sids['AAPL'],
value=1 / 7,
value=7.0,
)],
}
]
Expand Down
2 changes: 1 addition & 1 deletion zipline/data/bundles/quandl.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def fetch_single_equity(api_key,

def _update_splits(splits, asset_id, raw_data):
split_ratios = raw_data.split_ratio
df = pd.DataFrame({'ratio': split_ratios[split_ratios != 1]})
df = pd.DataFrame({'ratio': 1 / split_ratios[split_ratios != 1]})
df.index.name = 'effective_date'
df.reset_index(inplace=True)
df['sid'] = asset_id
Expand Down

0 comments on commit e4934cc

Please sign in to comment.