License
BSD-3-Clause
The DataFrame layer of ddn.df: an ordered collection of named Series columns of equal height (D11).
A DataFrame is a value type; copying copies the column array, not the data. Construction validates equal heights and unique names; lookups resolve by name (df["x"]) or position (df[0], df[1u]); logical equality compares schema and values regardless of per-column chunking.
A table: named, typed Series columns of equal height. DataFrame.init is the empty frame (no columns, height 0).
private ColumnBatch _batchSeries[] _columns() @property const @trusted pure nothrowThe frame's columns (the carrier's storage, shared - never a copy).DataFrame rename(string[] from, string[] to) @safe pureRenames columns: `rename(["a", "b"], ["x", "y"])`.DataFrame join(DataFrame other, string on,
JoinKind kind = JoinKind.INNER, string suffix = "_right")Joins another frame on equal-dtype key columns (INNER default, or LEFT): rows in left-frame order, right-frame order within one left row; null keys never match; the key coalesces; right-side collis...DataFrame join(DataFrame other, string[] leftOn, string[] rightOn,
JoinKind kind = JoinKind.INNER, string suffix = "_right")Ditto, the multi-column join (ADR-2026-10-30-03): a row matches only when every key pair holds; any null component never matches. OUTER coalesces every paired key column.DataFrame join(DataFrame other, string[] on,
JoinKind kind = JoinKind.INNER, string suffix = "_right")Ditto, the same key names on both sides.DataFrame crossJoin(DataFrame other, string suffix = "_right")The cross join (ADR-2026-10-30-03): the left-major nested loop - every left row in order, all right rows in right order within it - with the row count overflow-checked before any allocation. Right-...DataFrame joinAsof(DataFrame other, string leftOn, string rightOn,
AsofDirection direction = AsofDirection.BACKWARD,
long tolerance = long.max)The sorted asof join (ADR-2026-10-30-03): for each left row, at most one right row - BACKWARD the last with `rightKey <= leftKey`, FORWARD the first with `>=`, NEAREST the smaller distance (exact t...DataFrame joinAsof(DataFrame other, string on,
AsofDirection direction = AsofDirection.BACKWARD,
long tolerance = long.max)Ditto, the same key name on both sides.DataFrame join(DataFrame other, string leftOn, string rightOn,
JoinKind kind = JoinKind.INNER, string suffix = "_right")Ditto, with different key column names on the two sides.GroupBy groupBy(string[] keys...)Groups the frame by its key columns: first-appearance group order, null keys forming their own group.DataFrame describe()Deduplicates the frame's rows (ADR-2026-10-23-08): the first occurrence of each distinct key tuple is kept, in first-appearance order, under the grouping's total multi-column equality (nulls equal,...Nullable!double colMaxAsDouble(Series col)auto deferred() @safe pure nothrowWraps the frame in a LazyFrame for deferred execution: build with .filter/.select/.withColumn/.sort/.limit, collect with .collect(). Nothing runs until collect. The result equals the equivalent eag...DataFrame pivot(string[] index, string on, string[] values,
PivotAgg agg = PivotAgg.NONE)Pivots the frame wide: the distinct values of `on` become columns, the distinct `index` tuples become rows, and the cells hold the `values` aggregated per (index tuple, on value) - first-appearance...DataFrame unpivot(string[] valueColumns, string[] indexColumns = [],
string variableName = "variable", string valueName = "value")Unpivots the frame long: the `valueColumns` stack into `variableName`/`valueName` pairs (value-column outer, input row inner), the `indexColumns` repeat per stacked column, and every other column d...DataFrame sort(string by, bool descending = false,
bool nullsLast = false)Sorts the frame by one key column (stable; nulls first by default).DataFrame sort(string[] by, bool[] descending, bool nullsLast = false)Sorts the frame by several key columns: one stable pass per key, last key first, so earlier keys break the ties of later ones.DataFrame slice(size_t start, size_t len)Row slice: every column is sliced identically, sharing its buffers.DataFrame filter(Series mask)Keeps the rows whose mask entry is `true`; a null mask entry counts as `false`. Every column is filtered identically.DataFrame dropNulls(string[] subset = null, NullHow how = NullHow.ANY)Drops rows by a null criterion over the selected columns. `how = ANY` (default) drops a row when any selected column is null; `how = ALL` drops a row only when every selected column is null. `subse...DataFrame withColumn(Series col) @safe pureAdds or replaces one column by name: an existing column of that name is replaced in place, otherwise the column is appended (with a height check).DataFrame withColumns(Series[] cols) @safe pureAdds or replaces several columns in one pass. The semantics are sequential `withColumn` over the array: an existing name is replaced at its own position, a new name is appended in batch order, and ...DataFrame insertColumn(size_t index, Series col) @safe pureAdds or replaces one column at a position. An existing name is replaced at its own position - the `index` applies to new names only. A new name is inserted at `index`, where `0 ..= width()` is vali...DataFrame vstack(DataFrame other)Stacks another frame below: the schemas must match by name and dtype (same order); the result references both frames' chunk arrays, so it is O(1) per column.string toString()Renders the frame Polars-style:size_t[] multiKeyArgSort(DataFrame frame, string[] by, bool[] descending,
bool nullsLast = false)Sorts the rows of a frame by its key columns: one stable pass per key, last key first, so earlier keys become the tie-break of later ones. Every pass applies the null placement. The frame adapter r...