Conversation
Implements Stats.describe (frame) and FrameStatsExtensions.Describe(df) as a Frame-level analogue of the existing Stats.describe (series). The new function applies Stats.describe to each numeric column (float) of the input frame and returns a Frame<string, 'C> with row keys 'unique', 'mean', 'std', 'min', '0.25', '0.5', '0.75', 'max'. Closes #398 Co-authored-by: Copilot <[email protected]>
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.
🤖 Repo Assist — automated AI improvement.
Closes #398
Summary
Implements
Stats.describeforFrame<'R,'C>(and correspondingFrameStatsExtensions.Describefor C#), a long-requested (#398) pandas-style summary statistics method.What it does
Calling
Stats.describe frameproduces aFrame(string, 'C)with one column per numeric column of the input frame, and these row keys:uniquemeanstdmin0.250.50.75maxOnly columns convertible to
floatare included (viaframe.GetColumns(float)()). Non-numeric columns are silently dropped, matching the behaviour of pandas.Usage (F#)
Usage (C#)
Root cause / approach
Stats.describealready exists forSeries<'K,'V>and returns aSeries(string, float). The frame variant simply maps this function over all numeric columns viaframe.GetColumns(float)() |> Series.map (fun _ s -> Stats.describe s)and assembles the result into a frame usingFrameUtils.fromColumns.Files changed
src/Deedle/Stats.fsStats.describe (frame:Frame<'R,'C>)src/Deedle/FrameStatsExtensions.fsDescribe()C# extension methodtests/Deedle.Tests/Stats.fsdescribe works for frametestTest Status
✅ All 495 existing tests pass.
✅ New test
describe works for framepasses.