Skip to content

Commit

Permalink
BUG: Preserve output index in cum_returns.
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Sanderson committed Feb 27, 2018
1 parent 52687e1 commit aa05aa0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions empyrical/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,9 @@ def cum_returns(returns, starting_value=0, out=None):

if allocated_output:
if returns.ndim == 1 and isinstance(returns, pd.Series):
out = pd.Series(out)
out = pd.Series(out, index=returns.index)
elif isinstance(returns, pd.DataFrame):
out = pd.DataFrame(out)
out = pd.DataFrame(out, index=returns.index)

return out

Expand Down

0 comments on commit aa05aa0

Please sign in to comment.