Open rben01 opened 3 months ago
More of a feature request. We don't support that yet, the array type is rather new.
Thanks. Is there anyway to do row-wise inner product on List or Array columns? I've tried manually zipping by using indices as shown below, but I get ComputeError: named columns are not allowed in `list.eval`
df.with_columns(
pl.int_ranges(pl.col("a").list.len()).list.eval(
(pl.col("a").list.get(pl.element()) * pl.col("b").list.get(pl.element())).sum()
)
)
Checks
Reproducible example
Log output
Issue description
I guess that after computing the elementwise product, Polars fails to take the sum of the resulting array?
Expected behavior
0 * 10 + 1 * 11 + 2 * 12 = 35
Installed versions