Created
December 7, 2012 18:09
-
-
Save paultag/4235162 to your computer and use it in GitHub Desktop.
python-sunlight in clojure-py
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
(ns sunup | |
(:require sunlight)) | |
(defn frequencies [coll] | |
(reduce (fn [counts x] (assoc counts x (inc (get counts x 0)))) {} coll)) | |
(frequencies | |
(for [l (kwapply | |
(.-legislators sunlight/openstates) | |
{"state" "ma"}) | |
] (get l "party")))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output: