I am somewhat new to functional programming. To improve the performance of a package, I would like to re-write a package in a functional style.
I have the following Dataset
:
testPoints = Dataset[{ <|"id"->1, "x"->3.75, "y"->3.75, "z"->1.5 |>,
<|"id"->2, "x"->-3.75, "y"->3.75, "z"->1.5 |>,
<|"id"->3, "x"->-0.95, "y"->-0.95, "z"->1.5 |>,
<|"id"->4, "x"->0.95, "y"->-0.95, "z"->1.5 |>,
<|"id"->5, "x"->0.95, "y"->0.95, "z"->1.17 |>,
<|"id"->6, "x"->-0.95, "y"->0.95, "z"->1.17 |>,
<|"id"->7, "x"->-2.84, "y"->-2.84, "z"->1.17 |>,
<|"id"->8, "x"->2.84, "y"->-2.84, "z"->1.17 |>,
<|"id"->9, "x"->4.01, "y"->0, "z"->0.83 |>,
<|"id"->10, "x"->0, "y"->4.01, "z"->0.83 |>,
<|"id"->11, "x"->-2.67, "y"->0, "z"->0.83 |>,
<|"id"->12, "x"->0, "y"->-2.67, "z"->0.83 |>,
<|"id"->13, "x"->1.89, "y"->1.89, "z"->0.5 |>,
<|"id"->14, "x"->-1.89, "y"->1.89, "z"->0.5 |>,
<|"id"->15, "x"->-3.75, "y"->-3.75, "z"->0.5 |>,
<|"id"->16, "x"->3.75, "y"->-3.75, "z"->0.5 |>}];
I am unclear on how I would specify specific columns in a Dataset
in a Map
or Apply
function.
How would I apply f[x]
, g[x,y]
or h[x,y,z]
to the rows in this Dataset
?