Skip to content

Commit

Permalink
fix: pandas deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
loiccoyle committed Jan 3, 2025
1 parent 80a576b commit d749b6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tinyticker/tickers/stock.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ def _fix_prepost(self, historical: pd.DataFrame) -> pd.DataFrame:
# when the market is closed, the volume is 0
prepost_range = historical["Volume"] == 0
# add one more row before and after open/close to make sure we don't miss the start/end
prepost_range |= prepost_range.shift(-1).fillna(False)
prepost_range |= prepost_range.shift(1).fillna(False)
prepost_range |= prepost_range.shift(-1, fill_value=False)
prepost_range |= prepost_range.shift(1, fill_value=False)
# When in prepost, the high & lows can be off
high_bars = historical["High"] - historical[["Close", "Open"]].max(axis=1)
low_bars = historical[["Close", "Open"]].min(axis=1) - historical["Low"]
Expand Down

0 comments on commit d749b6a

Please sign in to comment.