Nodes/ComfyUI-Data-Analysis/Pandas Lt Scalar Int
ComfyUI Node

Pandas Lt Scalar Int

The quick 'values below this threshold' mask

By HowToSD·Created 2 years ago·Updated about a year ago· 23
Pandas Lt Scalar Int
  • dataframe
  • DATAFRAME
number0

Some masks you build by hand. This one you just type a number for. Pandas Lt Scalar Int tests every cell of a DataFrame against a single integer and hands back a DataFrame of True/False - "is this value below N?" for the whole table at once. It's the integer-flavored member of the pack's scalar comparison family.

The pack is ComfyUI-Data-Analysis by Hide Inada (HowToSD) - pandas, Seaborn, and Matplotlib wrapped into ComfyUI nodes so you can do data analysis in the same canvas where you generate images. This node is a one-line wrapper around dataframe.lt(number), and like the float variant, its whole point is producing masks to filter on.

How it works

The node calls dataframe.lt(number) with number as an INT. Strictly less than the threshold → True; equal, greater, NaN, or non-numeric → False. The output is a boolean DataFrame with the same shape and labels as the input. As with all the pack's comparison nodes, that boolean table is the input to a filter - pair it with Pandas Boolean Index to keep only the rows that pass.

The inputs that matter

  • dataframe - the DATAFRAME being tested.
  • number - an INT, default 0, spanning the full signed 32-bit range. Your threshold.

Output: DATAFRAME of booleans.

Honest note: int vs float barely matters here. pandas upcasts automatically, so Pandas Lt Scalar Float with 5.0 and this node with 5 behave identically against numeric data. Pick the one that matches the numbers you're thinking in - integer thresholds, integer node.

How to install it

One pack, one 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 ComfyUI Manager → search "Data analysis" → install → restart → reload. The pack's dependencies (pandas, matplotlib, seaborn, scipy, scikit-learn) come with it; no GPU, no models.

Common issues

  • All False on clean-looking data - the columns are probably strings, not numbers, so comparisons produce NaNFalse. Convert to numeric first (Pandas As Float or the pack's conversion nodes).
  • Boundary confusion - it's strict <. Threshold hits exactly False; use Pandas Le Scalar Int for less-than-or-equal.
  • NaN never passes - expected. Missing values can't be less than anything.

It's a small, boring node, and that's its virtue: when you need a threshold mask, it's one node and one number, no ceremony.

CategoryData Analysis

Inputs (2)

NameTypeDefaultDescription
dataframeDATAFRAME
numberINT0-2147483648–2147483648

Outputs (1)

NameTypeDescription
DATAFRAMEDATAFRAME