[Repo Assist] Add Stats.levelMin and Stats.levelMax to F# API#647
Merged
[Repo Assist] Add Stats.levelMin and Stats.levelMax to F# API#647
Conversation
The C# extension methods MinLevel/MaxLevel (in SeriesStatsExtensions) already existed but the equivalent Stats.levelMin and Stats.levelMax were missing from the F# Stats module, creating an asymmetry. Both functions follow the exact same pattern as existing level stats (levelMean, levelMedian, levelSkew, etc.) using Series.applyLevel. They return NaN for groups with no non-missing values, consistent with Stats.min / Stats.max. Tests: 4 new assertions in 'Basic level statistics works on sample input'. All 612 existing tests continue to pass. 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.
🤖 Repo Assist — coding improvement (Task 5).
Summary
Stats.levelMinandStats.levelMaxwere missing from the F#Statsmodule, creating an asymmetry with the C# extension methodsMinLevel/MaxLevel(which already existed inSeriesStatsExtensions).This PR adds the two missing functions, completing the set of level-aggregation statistics alongside
levelMean,levelMedian,levelSum,levelCount,levelStdDev,levelVariance,levelSkew, andlevelKurt.Changes
src/Deedle/Stats.fs— two new one-liner functions:Both follow the exact existing pattern (
Series.applyLevel level Stats.min/max). ReturnNaNfor groups with no non-missing values, consistent withStats.min/Stats.max.tests/Deedle.Tests/Stats.fs— 4 new assertions added to the existingBasic level statistics works on sample inputtest.Why is this a good change?
MinLevel/MaxLevel; F# users had to roll their own withSeries.applyLevel.Test Status
✅ All 612 existing tests pass on Linux (
dotnet test tests/Deedle.Tests/Deedle.Tests.fsproj -c Release).