Skip to content

Aggregate the columns to a unique quantile value

Description

Aggregate the columns to a unique quantile value

Usage

<DataFrame>$quantile(
  quantile,
  interpolation = c("nearest", "higher", "lower", "midpoint", "linear")
)

Arguments

quantile Quantile between 0.0 and 1.0.
interpolation Interpolation method.

Value

A polars DataFrame

Examples

library("polars")

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