Skip to content

Commit

Permalink
more pandas fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Carver committed Nov 22, 2023
1 parent dd5e61c commit 23a1be0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sysproduction/data/risk.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def get_current_ann_stdev_of_prices(data, instrument_code):
try:
current_stdev_ann_price_units = get_ann_ts_stdev_of_prices(
data=data, instrument_code=instrument_code
)[-1]
).iloc[-1]
except:
## can happen for brand new instruments not properly loaded
return np.nan
Expand Down
2 changes: 1 addition & 1 deletion sysproduction/reporting/data/pricechanges.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,4 @@ def get_stdev_at_start_date_for_instrument(
daily_returns = daily_price_series.diff()
vol_series = daily_returns.ewm(30).std()

return vol_series[-1]
return vol_series.iloc[-1]

0 comments on commit 23a1be0

Please sign in to comment.