`polars.cumsum()` is now `.cum_sum()`

qt_w_graceful_SIGINT
Tyler Goodlet 2025-09-27 12:24:11 -04:00
parent 3f48098c55
commit 62f27bf509
1 changed files with 3 additions and 3 deletions

View File

@ -493,7 +493,7 @@ def ledger_to_dfs(
df = dfs[key] = ldf.with_columns([
pl.cumsum('size').alias('cumsize'),
pl.cum_sum('size').alias('cumsize'),
# amount of source asset "sent" (via buy txns in
# the market) to acquire the dst asset, PER txn.
@ -508,7 +508,7 @@ def ledger_to_dfs(
]).with_columns([
# rolling balance in src asset units
(pl.col('dst_bot').cumsum() * -1).alias('src_balance'),
(pl.col('dst_bot').cum_sum() * -1).alias('src_balance'),
# "position operation type" in terms of increasing the
# amount in the dst asset (entering) or decreasing the
@ -650,7 +650,7 @@ def ledger_to_dfs(
# cost that was included in the least-recently
# entered txn that is still part of the current CSi
# set.
# => we look up the cost-per-unit cumsum and apply
# => we look up the cost-per-unit cum_sum and apply
# if over the current txn size (by multiplication)
# and then reverse that previusly applied cost on
# the txn_cost for this record.