Conversation
Implements iloc-style integer-position based indexing for both Series and Frame, addressing #444. New functions: - Series.iloc (positions: seq<int>) : Series<'K,'T> -> Series<'K,'T> Returns a series with elements at the given integer positions, preserving the original keys. - Frame.ilocRows (rowPositions: seq<int>) : Frame<'R,'C> -> Frame<'R,'C> Returns a frame with only the rows at the given integer positions. - Frame.ilocCols (colPositions: seq<int>) : Frame<'R,'C> -> Frame<'R,'C> Returns a frame with only the columns at the given integer positions. - Frame.iloc (rowPositions: seq<int>) (colPositions: seq<int>) : Frame<'R,'C> -> Frame<'R,'C> Returns a sub-frame selecting both rows and columns by position, equivalent to pandas DataFrame.iloc[rows, cols]. All four functions are also exposed as compiled names (Iloc, IlocRows, IlocCols) for C# consumers. 7 new tests added; all 595 tests pass. Co-authored-by: Copilot <[email protected]>
This was referenced Mar 17, 2026
Closed
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 is an automated PR from Repo Assist.
Closes #444
Summary
Implements
iloc-style integer-position based indexing for bothSeriesandFrame, equivalent to the pandasilocaccessor.New API
Series.ilocOriginal keys are preserved.
Frame.ilocRowsFrame.ilocColsFrame.ilocImplementation
All four functions resolve integer positions to the underlying keys using the existing
GetRowKeyAt/ColumnIndex.KeyAtmethods, then delegate toframe.Rows.[keys]/frame.Columns.[keys]/series.GetItems(keys). This keeps the implementation minimal and leverages battle-tested code paths.The functions are also compiled under PascalCase names (
Iloc,IlocRows,IlocCols) so they are usable from C#.Test Status
✅ 7 new tests added in
Frame.fsandSeries.fs✅ All 595 tests pass (
dotnet test tests/Deedle.Tests/Deedle.Tests.fsproj -c Release)