ComfyUI Node

Pandas Cummin

The running minimum, for when only the worst-so-far matters

By HowToSD·Created 2 years ago·Updated about a year ago· 23
Pandas Cummin
  • dataframe
  • DATAFRAME
axis

Pandas Cummin is the pessimistic twin of Cummax. Where the cumulative max tracks the best value so far, the cumulative minimum tracks the worst - each output cell is the smallest value seen up to that point in the sequence. It's the calculation behind "what's the lowest this metric has ever been," "when did this series bottom out," or drawdown analysis where you want the running trough rather than the peak.

Mechanically it's a thin wrapper around pandas:

df_out = dataframe.cummin(axis=0 if axis == "index" else 1)

The one input you'll touch, besides the dataframe itself, is the axis enum with its two choices: index or columns. And the recurring trap applies here exactly as it does to Cummax and Cumsum: "index" means down the rows (pandas axis=0), "columns" means across (axis=1). If you want a running minimum computed down a vertical column of numbers, select index. The wording comes from pandas' perspective, and it reads backwards until you've internalized it. The node doesn't validate your intent - it just computes along whatever axis you picked.

The output is a DATAFRAME of the same shape as the input, cell-for-cell the running minimum. Like the other cumulative nodes, NaNs are infectious: a missing value pins the running minimum at NaN until a non-missing value shows up again. So either clean the frame first with Pandas Drop NA or Pandas Fill NA, or accept the blanks.

When you'd actually use it

Realistically, Cummin is the least-used of the four cumulative nodes - cumulative max, sum, and product all show up more in practice. But it earns its place when you're tracking error metrics that should only ever go down (loss curves in training logs, error rates) and you want the best-so-far minimum plotted alongside. It's also the natural complement in a workflow that already computes cummax: two wires in, "best and worst so far" out.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/HowToSD/ComfyUI-Data-Analysis.git
mv ComfyUI-Data-Analysis data-analysis
pip install -r requirements.txt

or via ComfyUI Manager (search "Data analysis"), then restart ComfyUI. No GPU, no model files - pandas is the whole engine, and the pack pulls it in via requirements.txt if Manager didn't.

CategoryData Analysis

Inputs (2)

NameTypeDefaultDescription
dataframeDATAFRAME
axisCOMBO2 options: index, columns

Outputs (1)

NameTypeDescription
DATAFRAMEDATAFRAME