1 User guide
Every snippet has a runnable counterpart under user-guide/<chapter>/ in the project repository, paired with the equivalent Python program:
racket user-guide/getting-started/expressions-and-contexts.rkt |
python user-guide/getting-started/expressions_and_contexts.py |
The exception is the closing case study, Case study: nycflights, which replays a blog post rather than an upstream page; examples/69-nycflights-replay.rkt runs its main steps as a script.
Snippets use the fluent, thread-first style: each verb takes the frame —
1.1 Getting started
See Operators and pipelines for the definition of every verb used here.
1.2 Concepts
See Operators and pipelines for the operators and contexts used here.
1.3 Expressions
See Operators and pipelines for col, all, exclude and over.
1.4 Time series
See Dates, times, datetimes and durations for how gregor values map to the temporal dtypes.
The examples read upstream’s "apple_stock.csv", a hundred closing prices of Apple stock from 1981 to 2014.
API gaps: no group_by_dynamic, rolling or upsample, so upstream’s Grouping and Resampling pages have no counterpart.
1.5 IO
See Operators and pipelines for read-csv, scan-csv and the other readers.
1.6 Interoperability
See Converting to Racket values for every conversion used here.
Handing Polars data to Racket code that is not Polars: a loop, a numeric routine, a foreign solver, a plot. The chapter mirrors upstream’s Arrow producer/consumer and Visualization pages, with the Python export calls those pages lean on: Series.to_list, Series.to_numpy, DataFrame.to_dict and DataFrame.to_numpy.
1.7 Case study: nycflights
See Operators and pipelines for the verbs used here, and Series and DataFrames for the conversions, define-enum, describe and the accessors.
Data frames for Racket (aliquote.org, July 2023) loads the 29 MB nycflights.tsv, every flight that left New York in 2013, with three Racket libraries, then walks tabular-asa through a select, a distinct, a group-by and a density plot. Along the way it lists what the libraries cannot do: read another separator, keep categorical variables, parse dates, describe a string column usefully. This chapter replays each step in rkt-polars, the post’s code first, and answers each complaint.