Skip to content

Commit fbf8d5e

Browse files
committed
🔍 fix float index problem of #63
1 parent b8588c5 commit fbf8d5e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

plotly_resampler/aggregation/aggregators.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,13 @@ def _aggregate(self, s: pd.Series, n_out: int) -> pd.Series:
153153
# Calculate the argmin & argmax on the reshaped view of `s` &
154154
# add the corresponding offset
155155
argmin = (
156-
s[: block_size * offset.shape[0]]
156+
s.iloc[: block_size * offset.shape[0]]
157157
.values.reshape(-1, block_size)
158158
.argmin(axis=1)
159159
+ offset
160160
)
161161
argmax = (
162-
s[argmax_offset : block_size * offset.shape[0] + argmax_offset]
162+
s.iloc[argmax_offset : block_size * offset.shape[0] + argmax_offset]
163163
.values.reshape(-1, block_size)
164164
.argmax(axis=1)
165165
+ offset
@@ -218,13 +218,13 @@ def _aggregate(self, s: pd.Series, n_out: int) -> pd.Series:
218218
# Calculate the argmin & argmax on the reshaped view of `s` &
219219
# add the corresponding offset
220220
argmin = (
221-
s[: block_size * offset.shape[0]]
221+
s.iloc[: block_size * offset.shape[0]]
222222
.values.reshape(-1, block_size)
223223
.argmin(axis=1)
224224
+ offset
225225
)
226226
argmax = (
227-
s[: block_size * offset.shape[0]]
227+
s.iloc[: block_size * offset.shape[0]]
228228
.values.reshape(-1, block_size)
229229
.argmax(axis=1)
230230
+ offset

0 commit comments

Comments
 (0)