Skip to content

Aggregate the columns of this DataFrame to their sum values

Description

Aggregate the columns of this DataFrame to their sum values

Usage

<DataFrame>$sum()

Value

A polars DataFrame

Examples

library("polars")

df <- pl$DataFrame(a = 1:4, b = c(1, 2, 1, 1))
df$sum()
#> shape: (1, 2)
#> ┌─────┬─────┐
#> │ a   ┆ b   │
#> │ --- ┆ --- │
#> │ i32 ┆ f64 │
#> ╞═════╪═════╡
#> │ 10  ┆ 5.0 │
#> └─────┴─────┘