3 ms·
I made that up beforehand and it may be exaggerated, I was inspired by the List Monad. The groups are deterministic. The non-determinism lies in which element
by hackandthink 3y ago
I made that up beforehand and it may be exaggerated, I was inspired by the List Monad.
The groups are deterministic. The non-determinism lies in which element of the group is then selected.
"Calculate an even number"
equals
"Take any element from the group of even numbers"
https://www.schoolofhaskell.com/school/starting-with-haskell/basics-of-haskell/13-the-list-monad#non-deterministic-computations https://www.schoolofhaskell.com/school/starting-with-haskell...
- alexmolas 3y agoYes, when you aggregate the group's values, you can have non-deterministic behaviors. Operations like "calculate an even number" can be non-deterministic, but other operations like "give me the group average" (which is what the post proposes) are deterministic. Anecdote time: some weeks ago I had a bug for this reason. I was doing a groupby + select the first element, and since the first element is not always the same I was getting some weird results. I solved it by sorting the group elements before selecting the first element.