I have the following dataset:
ds = Dataset@{
<|"x" -> 1, "y" -> 45|>,
<|"x" -> 2, "y" -> 19|>,
<|"x" -> 3, "y" -> 20|>,
<|"x" -> 4, "y" -> 47|>,
<|"x" -> 5, "y" -> 30|>
};
How can I transform the "y"
values so that each y_i
is replaced by y_i - Max[#y]
, where Max[#y]
is the maximum of the "y"
column.
I would like to verify whether this means that I need to store in some variable the value of Max[#x]
, or this rather can be done in one step with a pure function.