Repository navigation
v0.1.2
Adds the two APIs another package needs to read data out of a frame efficiently.
[workspace]
preview = ["pixi-build"]
[dependencies]
mojo = ">=1.1.0,<1.2"
dataframe_mojo = { git = "https://github.com/randyzwitch/dataframe_mojo.git", tag = "v0.1.2" }Arrow buffer access (#91)
unsafe_values(), unsafe_validity() / validity_offset(), unsafe_bytes() / unsafe_offsets() for large_utf8, a non-raising is_valid(i), and to_list(). A consumer reads values in place instead of one tagged AnyValue per element: summing a million-row Float64 column drops from about 3,500 us to about 700 us.
The values pointer is shifted to the window's row 0; the validity bitmap is not, so bit validity_offset() + i describes row i. Null slots hold whatever the buffer holds, as in Arrow, where they are undefined. Nothing converts dtypes.
Row-index grouping (#92)
DataFrame.group_indices(keys) gives the grouping without the aggregation: ids, rows(g), all_rows, sizes, count, and representative(g) for where a group's key values live. Building sub-frames is left to the caller, who may prefer to index the shared buffers directly.
The two compose: hold row indices per group and read values straight from the buffers, without materializing a sub-frame per group.
Targets Mojo 1.1. A compiled Mojo package only loads in the Mojo version that produced it, and pixi builds a source dependency with the newest Mojo that [package.host-dependencies] allows rather than the consumer's pin, so each tag targets one Mojo version.