Skip to content

v0.40.0 - v2 DataFrame Migration (2026-03-23)

What Changed?

This release expands the src/v2/ module by adding seven new methods to DataFrame and three to FlameFrame, bringing the v2 API closer to feature parity with the legacy v1 DataFrame. Methods that have been migrated to v2 are now marked @deprecated Since 0.40.0 in the v1 class, signaling the start of the gradual v1 removal process.


What's New

Main Feature: v2 DataFrame method expansion

What it does: Adds the most commonly used data-access and transformation methods to the new DataFrame (in src/v2/frame.ts) and FlameFrame (in src/v2/flameframe.ts). The v2 API is immutable by design — every method returns a new instance instead of mutating the original.

How to use it:

TypeScript
import { DataFrame, FlameFrame, FlameGuards } from "./v2";

const df = DataFrame.fromColumns({
  name:  ["Alice", "Bob", "Charlie"],
  age:   [25, null, 35],
  score: [95, 87, 92],
});

// Fill missing values
const filled = df.fillna(0);

// Descriptive statistics (numeric columns only)
df.describe();
// column | count | mean | min | max
// age    | 2     | 30   | 25  | 35
// score  | 3     | 91.3 | 87  | 95

// Access a single row or column
df.getRow(0);          // Map { "name" => "Alice", "age" => 25, "score" => 95 }
df.getColumn("score"); // [95, 87, 92]

// Reshape
const long = df.melt({ idVars: ["name"] });
const wide = long.pivot({ index: "name", columns: "variable", values: "value" });

// Schema-validated wrapper
const { frame, errors } = FlameFrame.fromColumns(
  { name: ["Alice", "Bob"], age: [25, 30] },
  { name: FlameGuards.isString, age: FlameGuards.isNumber },
);
const { frame: filled2 } = frame.fillna(0);

Added

  • DataFrame.fillna(value) — replace null, undefined, and "" cells with a fill value
  • DataFrame.melt(options) — reshape from wide to long format (MeltOptions type added)
  • DataFrame.pivot(options) — reshape from long to wide format (PivotOptions type added)
  • DataFrame.getRow(index) — return a single row as Map<string, Cell>
  • DataFrame.getColumn(name) — return a single column as Cell[]
  • DataFrame.toObjects() — convert to Record<string, Cell>[] (JSON-serializable)
  • DataFrame.describe() — descriptive statistics for numeric columns
  • FlameFrame.fillna(value) — delegates to DataFrame.fillna, re-validates schema
  • FlameFrame.melt(options) — delegates to DataFrame.melt, returns plain DataFrame
  • FlameFrame.pivot(options) — delegates to DataFrame.pivot, returns plain DataFrame
  • cspell.json — project-level spell-checker config (fillna, unpivot, nums, maxs)

Changed

  • v1 DataFrame methods marked @deprecated Since 0.40.0 with migration pointers to v2:
  • src/torch/dataframe/analysis/statistics.ts: fillna, melt, pivot
  • src/torch/dataframe/core/dataframe.ts: fromMap, fromArrays, fromSheet, fromRange, withColumn, select, drop, filter, rename, slice, head, tail, toString, toTableString, display, toArrays, toObjects, groupBy, joinInner, joinLeft, joinRight, joinOuter, concat, concatVertical, concatHorizontal, sort, getRow, getColumn, describe

Is It Safe to Upgrade?

  • Breaking Changes: No
  • Backward Compatible: Yes

All v1 methods continue to work. The @deprecated tags only generate IDE hints — no runtime behavior is changed. The v2 API is additive.


Release Details

  • Date: 2026-03-23
  • Version: v0.40.0
  • gaslamp: version 87
  • pilotlamp: version 44
  • Files Changed: 151
  • Commits:
    • 48532de bump: version 0.39.1 → 0.40.0
    • df5fc58 docs(torch/dataframe): deprecate describe in favor of v2
    • 125738c feat(v2/frame): add DataFrame.describe
    • c05f0e8 docs(torch/dataframe): fix deprecated notice for toObjects
    • f25e26d feat(v2/frame): add DataFrame.toObjects
    • f567918 docs(torch/dataframe): deprecate getColumn in favor of v2
    • caea9e3 feat(v2/frame): add DataFrame.getColumn
    • b84327c docs(torch/dataframe): deprecate getRow in favor of v2
    • f17d317 feat(v2/frame): add DataFrame.getRow
    • e34149b docs(torch/dataframe): deprecate migrated methods since 0.40.0
    • 067b5c3 feat(v2/flameframe): add FlameFrame.pivot returning DataFrame
    • e3d5e37 feat(v2/frame): add PivotOptions type and DataFrame.pivot
    • 01bcd59 feat(v2/flameframe): add FlameFrame.melt returning DataFrame
    • 07a2ba7 feat(v2/frame): add MeltOptions type and DataFrame.melt
    • 7674dce feat(v2/flameframe): add FlameFrame.fillna
    • 7fc8bac feat(v2/frame): add DataFrame.fillna
    • 44e7b0f chore: add cspell.json with fillna word

Known Issues

  • FlameFrame.melt and FlameFrame.pivot return a plain DataFrame because the column structure changes after reshaping. Use FlameFrame.from(result, newSchema) to re-apply schema validation if needed.
  • describe does not compute standard deviation (std). This may be added in a future release.

Next Steps

  • Implement remaining v2 methods: transpose, explode*, toCSV, toJSON
  • Remove v1 DataFrame class after a few versions of parallel availability