median
Computes the median of values.
Is available for Comparable
columns. NA
values (null
and NaN
) are ignored.
df.median() // median of values per every comparable column
df.median { age and weight } // median of all values in `age` and `weight`
df.medianFor { age and weight } // median of values per `age` and `weight` separately
df.medianOf { (weight ?: 0) / age } // median of expression evaluated for every row
df.median()
df.age.median()
df.groupBy { city }.median()
df.pivot { city }.median()
df.pivot { city }.groupBy { name.lastName }.median()
See statistics for details on complex data aggregations.
Last modified: 27 September 2024