Skip to content

[Repo Assist] Add Stats.describe for Frame (pandas-style per-column summary statistics)#612

Merged
dsyme merged 2 commits intomasterfrom
repo-assist/improve-stats-describe-frame-2026-03-09-bcbbfe81ef135a62
Mar 12, 2026
Merged

[Repo Assist] Add Stats.describe for Frame (pandas-style per-column summary statistics)#612
dsyme merged 2 commits intomasterfrom
repo-assist/improve-stats-describe-frame-2026-03-09-bcbbfe81ef135a62

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented Mar 9, 2026

🤖 Repo Assist — automated AI improvement.

Closes #398

Summary

Implements Stats.describe for Frame<'R,'C> (and corresponding FrameStatsExtensions.Describe for C#), a long-requested (#398) pandas-style summary statistics method.

What it does

Calling Stats.describe frame produces a Frame(string, 'C) with one column per numeric column of the input frame, and these row keys:

Key Meaning
unique number of unique values
mean arithmetic mean
std sample standard deviation
min minimum
0.25 25th percentile
0.5 median
0.75 75th percentile
max maximum

Only columns convertible to float are included (via frame.GetColumns(float)()). Non-numeric columns are silently dropped, matching the behaviour of pandas.

Usage (F#)

let df = Frame.ofColumns [ "Open", openSeries; "Close", closeSeries ]
let summary = Stats.describe df
// summary is a Frame(string, string)
// summary.["Open", "mean"]  -> mean of Open column
// summary.["Close", "min"]  -> min of Close column

Usage (C#)

var summary = df.Describe();
// summary["Open", "mean"]  -> mean of Open column

Root cause / approach

Stats.describe already exists for Series<'K,'V> and returns a Series(string, float). The frame variant simply maps this function over all numeric columns via frame.GetColumns(float)() |> Series.map (fun _ s -> Stats.describe s) and assembles the result into a frame using FrameUtils.fromColumns.

Files changed

File Change
src/Deedle/Stats.fs Added Stats.describe (frame:Frame<'R,'C>)
src/Deedle/FrameStatsExtensions.fs Added Describe() C# extension method
tests/Deedle.Tests/Stats.fs Added describe works for frame test

Test Status

✅ All 495 existing tests pass.
✅ New test describe works for frame passes.

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@30f2254f2a7a944da1224df45d181a3f8faefd0d

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]>
@dsyme dsyme marked this pull request as ready for review March 12, 2026 02:21
@dsyme dsyme merged commit 1966c6f into master Mar 12, 2026
2 checks passed
@dsyme dsyme deleted the repo-assist/improve-stats-describe-frame-2026-03-09-bcbbfe81ef135a62 branch March 12, 2026 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Describe method for the Frame

1 participant