Conversation
… keys Implements the long-requested Frame.interleave function (issue #187). Given a list of frames, each frame's columns are tagged with their 1-based position in the input list, and all frames are joined (outer) on the row index. Frame.interleave [df1; df2] // columns: [('a',1); ('b',1); ('a',2); ('b',2)] Also exposes a C# extension method FrameUtils.Interleave on IEnumerable. Adds 6 tests covering: column key shape, value correctness, 3-frame case, single-frame identity, outer-join on rows, and empty-list guard. Closes #187 Co-authored-by: Copilot <[email protected]>
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.
Implements the long-requested
Frame.interleavefunction from issue #187.What it does
Given a list of frames with the same column keys,
Frame.interleaveplaces them side-by-side, tagging each frame's columns with its 1-based position in the input list. The result has a'C * intcolumn index.Rows are aligned with an outer join, so frames with disjoint row keys also work.
Changes
src/Deedle/FrameModule.fs— addsFrame.interleave : Frame<'R,'C> list -> Frame<'R, 'C * int>afterFrame.mergein the "Joining, merging and zipping" categorysrc/Deedle/FrameExtensions.fs— addsFrameUtils.Interleave(seq(Frame<'R,'C)>)C# extension methodtests/Deedle.Tests/Frame.fs— adds 6 tests:(colKey, 1-based-index))('c', 1))ArgumentExceptionImplementation notes
The implementation is minimal and composes existing primitives:
6 new tests added (690 base → 696). Full build (
dotnet build src/Deedle/Deedle.fsproj -c Release) succeeds with 0 errors.Closes #187