Skip to content

Commit

Permalink
Tiny update for new Pandas syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Hvass-Labs committed Feb 17, 2021
1 parent ae6e9db commit c84730f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion recovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def recovery_days(tot_ret):
# For each element in the Total Return time-series.
for cur_idx in range(len(tot_ret)):
# Value of the current element in the time-series.
cur_val = tot_ret.values[cur_idx]
cur_val = tot_ret.iloc[cur_idx]

# Remove all previous elements from the stack whose value
# is less than the current element from the time-series.
Expand Down
2 changes: 1 addition & 1 deletion returns.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def total_return(df):
tot_ret = tot_ret_daily.cumprod()

# Replace the first row's NA with 1.0
tot_ret.values[0] = 1.0
tot_ret.iloc[0] = 1.0

return tot_ret

Expand Down

0 comments on commit c84730f

Please sign in to comment.