A fast, efficient, in-memory, immutable, dataframes implementation for Racket.
This is a brief example of loading a table from a CSV, filtering, grouping, aggregating, and plotting the data. Note: This example uses ~>
from the threading module for clarity, but Tabular Asa does not require it.
(require plot)
(require tabular-asa)
(require threading)
(define books (call-with-input-file "books.csv" table-read/csv))
(let ([df (~> books
(table-drop-na '(Publisher))
(table-cut '(Genre Title))
(table-groupby '(Genre))
(group-count))])
(parameterize ([plot-x-tick-label-angle 30]
[plot-x-tick-label-anchor 'top-right])
(plot (discrete-histogram (for/list ([x (table-column df 'Genre)]
[y (table-column df 'Title)])
(list x y)))
#:x-label "Genre"
#:y-label "Number of Titles Published")))
The above should produce a image plot like this:
Installing should be as simple as using raco
from the command line:
% raco pkg install tabular-asa
After the above, you should be able to (require tabular-asa)
and begin working!
Refer to the scribble documentation.
This code is licensed under the MIT license. See the LICENSE.txt file in this repository for the complete text.