mapValues
Applies transform to the values from the columns previously selected by gather.
This is an intermediate step; returns a new Gather with transformed values.
For more information, see: See gather on the documentation website.
See also: Grammar.
Example
// Gather `resultA` and `resultB` columns into a single "value" column,
// with the "series" column containing a key.
// Assuming `resultA` and `resultB` contain `Double` values,
// `mapValues` transforms each value using the provided expression.
df.gather { resultA and resultB }
.mapValues { (it + 0.5).toFloat() }
.into("series", "value")Content copied to clipboard
Return
A new Gather instance with transformed values.