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

Pandas Lt Scalar Float

'every value under this number?' in one node

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

This is the node you'll actually reach for when you want to ask "which values are under a threshold?" Pandas Lt Scalar Float compares every cell in a DataFrame against one floating-point number and returns a DataFrame of True/False. It's the scalar sibling of Pandas Lt - instead of dragging in a second DataFrame, you type a number and it's applied everywhere.

It's part of ComfyUI-Data-Analysis, the pack from Hide Inada (HowToSD) that brings pandas into the ComfyUI canvas for data analysis alongside image generation. This node is a thin wrapper over pandas' own DataFrame.lt(number) - one method call, no surprises.

How it works

The node runs dataframe.lt(number) where number is your typed float. Every cell that's strictly less than the threshold becomes True; cells equal to it, NaN cells, and non-numeric cells all come out False. Strictly less is the key word - this is <, not <=; for the inclusive version you want Pandas Le Scalar Float, which this pack also ships.

The output is a boolean DataFrame, and that's the thing to remember: it's not a filter by itself. Wire it into Pandas Boolean Index to actually pull the rows that pass, or keep it around as a flag table for your analysis.

The inputs that matter

  • dataframe - the DATAFRAME to test.
  • number - a FLOAT, default 0, range set to the full signed 64-bit float span. This is the threshold every cell is tested against.

Output is a DATAFRAME of booleans, same shape and labels as the input.

How to install it

Same pack, same 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, then restart ComfyUI and reload the page. Expect pandas, matplotlib, seaborn, scipy, and scikit-learn in your environment; no GPU or model files involved.

Common issues

  • Everything's False - check your data type. If your DataFrame columns are strings (common after a dirty load), the comparison coerces weirdly or fails. Clean the columns to numeric first.
  • Borderline values - remember it's strict <. A cell exactly equal to the threshold is False; use the Le variant if you want inclusivity.
  • NaN cells come back False - expected behavior, not a bug. Missing data never passes a less-than test.

If your threshold is an integer rather than a float, Pandas Lt Scalar Int does the same job - honestly either works since pandas will upcast. Use whichever matches your mental model.

CategoryData Analysis

Inputs (2)

NameTypeDefaultDescription
dataframeDATAFRAME
numberFLOAT0-9223372036854776000–9223372036854776000

Outputs (1)

NameTypeDescription
DATAFRAMEDATAFRAME