Closed Kimserey closed 6 years ago
Specifying the type in mapValues
fixes it as well:
[ "r1" => series [ "c1" => "a"; "c2" => "a"; "label" => "good" ]
"r2" => series [ "c1" => "a"; "c2" => "b"; "label" => "bad" ] ]
|> Frame.ofRows
|> Frame.pivotTable
(fun _ c -> c.GetAs<string>("c1"))
(fun _ c -> c.GetAs<string>("label"))
id
|> Frame.mapValues (fun (frame: Frame<string, string>) -> Frame.countRows frame)
good bad
a -> 1 1
Using
id
as theop
ofFrame.pivotTable
followed byFrame.mapValues
with an aggregate function -Frame.countRows
in my example - does not yield the same result as using the same aggregate function as theop
ofFrame.pivotTable
.This code:
Gives the unexpected result:
While this code:
Give the expected result:
Am I missing anything? Why do the results differ?