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)— replacenull,undefined, and""cells with a fill valueDataFrame.melt(options)— reshape from wide to long format (MeltOptionstype added)DataFrame.pivot(options)— reshape from long to wide format (PivotOptionstype added)DataFrame.getRow(index)— return a single row asMap<string, Cell>DataFrame.getColumn(name)— return a single column asCell[]DataFrame.toObjects()— convert toRecord<string, Cell>[](JSON-serializable)DataFrame.describe()— descriptive statistics for numeric columnsFlameFrame.fillna(value)— delegates toDataFrame.fillna, re-validates schemaFlameFrame.melt(options)— delegates toDataFrame.melt, returns plainDataFrameFlameFrame.pivot(options)— delegates toDataFrame.pivot, returns plainDataFramecspell.json— project-level spell-checker config (fillna,unpivot,nums,maxs)
Changed¶
- v1
DataFramemethods marked@deprecated Since 0.40.0with migration pointers to v2: src/torch/dataframe/analysis/statistics.ts:fillna,melt,pivotsrc/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:
48532debump: version 0.39.1 → 0.40.0df5fc58docs(torch/dataframe): deprecate describe in favor of v2125738cfeat(v2/frame): add DataFrame.describec05f0e8docs(torch/dataframe): fix deprecated notice for toObjectsf25e26dfeat(v2/frame): add DataFrame.toObjectsf567918docs(torch/dataframe): deprecate getColumn in favor of v2caea9e3feat(v2/frame): add DataFrame.getColumnb84327cdocs(torch/dataframe): deprecate getRow in favor of v2f17d317feat(v2/frame): add DataFrame.getRowe34149bdocs(torch/dataframe): deprecate migrated methods since 0.40.0067b5c3feat(v2/flameframe): add FlameFrame.pivot returning DataFramee3d5e37feat(v2/frame): add PivotOptions type and DataFrame.pivot01bcd59feat(v2/flameframe): add FlameFrame.melt returning DataFrame07a2ba7feat(v2/frame): add MeltOptions type and DataFrame.melt7674dcefeat(v2/flameframe): add FlameFrame.fillna7fc8bacfeat(v2/frame): add DataFrame.fillna44e7b0fchore: add cspell.json with fillna word
Known Issues¶
FlameFrame.meltandFlameFrame.pivotreturn a plainDataFramebecause the column structure changes after reshaping. UseFlameFrame.from(result, newSchema)to re-apply schema validation if needed.describedoes 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
DataFrameclass after a few versions of parallel availability