Database Reference
In-Depth Information
In the output of the preceding line, we see something like the following screenshot:
How it works...
The most complicated part of this recipe is the transformation of the data to get the counts.
Let's break that apart line-by-line:
1. We start with the dataset we loaded from the CSV ile:
(->> shrooms
2.
We group that by the :cap-shape ield. This produces a hash map going from a map
like {:cap-shape 0.0} to a dataset:
(i/$group-by :cap-shape)
3.
We take each key-value pair in the group hash map and add the number of rows in
the dataset to the key. The output of this operation is a sequence of maps, such as
{:cap-shape 0.0, :count 452} :
(map (fn [[k v]] (assoc k :count (i/nrow v))))
 
Search WWH ::




Custom Search