deephaven-core
deephaven-core copied to clipboard
feat: Pivot table
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}")