Код: Выделить всё
result = (
d.with_columns(rolling_sum=pl.col('netloss').rolling_sum_by('created', window_size='24h').over('player_id'))
)
result = (
result.with_columns(
signal=pl.when(pl.col('rolling_sum')
Подробнее здесь: [url]https://stackoverflow.com/questions/79338779/how-to-enforce-a-cooldown-period-for-a-rolling-signal-in-polars[/url]
Мобильная версия