Skip to content

Commit

Permalink
fix (#229)
Browse files Browse the repository at this point in the history
```
/home/gordon/.local/lib/python3.11/site-packages/zipline/finance/ledger.py:424: FutureWarning: Series.__setitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To set a value by position, use `ser.iloc[pos] = value`
  self.daily_returns_series[session_ix] = self.todays_returns

```
On branch future_warning
Changes to be committed:
	modified:   src/zipline/finance/ledger.py
  • Loading branch information
gnzsnz committed Aug 6, 2024
1 parent e4fa752 commit ec36dd5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/zipline/finance/ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,11 +417,11 @@ def end_of_bar(self, session_ix):
# make daily_returns hold the partial returns, this saves many
# metrics from doing a concat and copying all of the previous
# returns
self.daily_returns_array[session_ix] = self.todays_returns
self.daily_returns_array.iloc[session_ix] = self.todays_returns

def end_of_session(self, session_ix):
# save the daily returns time-series
self.daily_returns_series[session_ix] = self.todays_returns
self.daily_returns_series.iloc[session_ix] = self.todays_returns

def sync_last_sale_prices(self, dt, data_portal, handle_non_market_minutes=False):
self.position_tracker.sync_last_sale_prices(
Expand Down

0 comments on commit ec36dd5

Please sign in to comment.