Conversation
…554) Adds Frame.meltBy, a new frame transformation that keeps specified identity columns and melts the remaining columns into Column/Value pairs. This is analogous to pandas DataFrame.melt(id_vars=...) and R data.table::melt. - Accepts any seq<'C> of id column keys - Outputs frame with columns: [id cols...] + Column + Value - Preserves original type of each identity column - Infers common supertype for value column (matching existing melt behaviour) - Adds 4 tests covering row count, column names, id values, and type preservation Co-authored-by: Copilot <[email protected]>
Contributor
Author
|
🤖 This is an automated response from Repo Assist. CI failure note: The build failures on this PR are not caused by the code changes here. After PR #590 upgraded PR #597 by
|
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
Adds
Frame.meltBy, a new frame-transformation function that keeps specified identity columns as-is and melts the remaining columns intoColumn/Valuepairs. This is analogous to pandasDataFrame.melt(id_vars=...)and R'sdata.table::melt.Closes #554.
Usage
Implementation
Frame.meltBy (idCols: seq<'C>) (frame: Frame<'R, 'C>)inFrameModule.fsseq<'C>of identity column keys (usesHashSetfor O(1) lookup)[id cols...] + "Column" + "Value")createTypedVectorValuecolumn (same strategy asFrame.melt)Tests
4 new tests in
Frame.fs:rows × value_cols)Column+ValueTest Status
✅ Build succeeded (0 errors, 4 warnings — all pre-existing)
✅ All 468 tests pass (including 4 new
meltBytests)