Module records
Expand description
The one table the Python surface hands back.
The coreβs Records is a list of named Columns, and a Column is a
typed enum β text, number or date. Flattening that into a mapping of
lists loses the discriminant, and a dataframe library then infers back what
the engine already knew: polars guesses a date column right, pandas gives
object, and one absent number turns a numeric column into object too.
So the type crosses whole. to_dict and to_rows are readings of it;
to_polars and to_pandas build with a declared schema taken from the
column kinds, which is the one thing a free function over a mapping could
not do. to_csv writes from the core columns directly and imports nothing.
StructsΒ§
- PyRecords
- A table of results: named columns of equal length, each carrying its kind.
FunctionsΒ§
- cell_
to_ πcsv - One cell as a CSV field, quoted only where it must be.
- cell_
to_ πpy - One cell as a Python object,
Nonefor an absent date. - column_
to_ πpy - One column as a Python list, each cell at its natural type.
- dated_
records π - A table of
(date, value)rows under the two names given. - escape_
html π textwith the five characters HTML reserves escaped.- import_
or_ πextra - The module
nameprovides, or anImportErrornaming the extra that installs it. - kind_of π
- The kind a column reports, and the word it reports it under.
- labelled_
records π - A table of
(label, value)rows, an absent label becoming an empty cell. - render_
html π - The table as HTML: a caption with the row count, a header row, one row
per record, numeric cells right-aligned. The cells are the ones
Displayprints, so a notebook and a prompt show the same figures. - strip_
records π - A table of
(expiry, end, value)rows under the three names given.