Created
January 5, 2017 14:58
-
-
Save cgrand/7a2a5c704d44da2622701c26ecb5f9d6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; simple stats computed using xforms transducers | |
=> (require '[net.cgrand.xforms :as x]) | |
=> (into {} | |
(x/by-key #(> % 0.5) | |
(x/transjuxt {:min x/min :max x/max :avg x/avg :sd x/sd})) | |
(repeatedly 1e6 rand)) | |
{false | |
{:min 1.0036018363024368E-6, | |
:max 0.4999987525112054, | |
:avg 0.2502046186242099, | |
:sd 0.14452907060127915}, | |
true | |
{:min 0.5000000325707634, | |
:max 0.9999996751822321, | |
:avg 0.7496015925827465, | |
:sd 0.1444535578897874}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment