deephaven-core icon indicating copy to clipboard operation
deephaven-core copied to clipboard

feat: Pivot table

Open chipkent opened this issue 5 months ago • 2 comments

Add support for computing pivot tables.

Example:

from deephaven import empty_table
from deephaven.experimental.pivot import pivot

y = empty_table(1000).select(["Row=ii%10", "Col=(int)((ii/10) % 30)", "Sentinel=random()"]).where(
    "Sentinel > 0.3")
ys = y.sum_by(["Row", "Col"])

pvt = pivot(ys, ["Row"], "Col", "Sentinel")
pvt2 = pivot(ys, "Row", "Col", "Sentinel", lambda x: f"Col_{x}")

chipkent avatar Sep 17 '24 21:09 chipkent