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

Pandas Ne Scalar Int

Pandas Ne Scalar Int

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

If you've ever stared at a spreadsheet and wanted to know "which cells are not this value?", this node is the answer wearing a graph. Pandas Ne Scalar Int does an element-wise not-equals comparison: it compares every single cell in a DataFrame against an integer you give it, and returns a new DataFrame of the same shape where each cell is True if it doesn't match and False if it does. It's one of those small nodes you reach for in a data-cleaning pass - flagging rows that deviated from an expected value, hunting for outliers, or prepping a mask before you filter or plot.

It's part of the HowToSD/ComfyUI-Data-Analysis pack, which wraps the pandas library into nodes so you can do structured data work entirely inside ComfyUI's canvas. The author's whole pitch is that ComfyUI shouldn't be image-only - and this is a good example of the mindset: plain pandas comparison operators, exposed one at a time as graph nodes.

How it works

Under the hood it's a single pandas call: dataframe.ne(number). "Ne" is pandas' not-equals operator, so ne compares each element to the scalar and builds a boolean DataFrame. Nothing fancy, no GPU involved, no model downloads - this pack is pure pandas/matplotlib/seaborn and runs on CPU happily.

There's one pandas behavior to remember here: NaN never equals anything, including itself, so any missing cell in your data will come back True. If that's not what you meant, filter or drop your nulls first with one of the pack's cleansing nodes.

The inputs and output that matter

Only two required inputs, and both are self-explanatory:

  • dataframe - the DATAFRAME you're testing.
  • number - the INT to compare every cell against. Defaults to 0, which makes this a handy "find all the non-zero values" tool out of the box.

The single output is a DATAFRAME of booleans. It wires straight into the pack's other nodes - use it as a mask before selecting rows, or feed it to a display node to actually eyeball which positions are True.

Installing it

Everything in this pack installs the same way. Easiest is ComfyUI Manager: open Manager → Custom Node Manager, search Data analysis, and install ComfyUI-Data-Analysis. It'll pull the Python dependencies for you. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/HowToSD/ComfyUI-Data-Analysis.git
# rename the folder to data-analysis or example workflows won't find it
mv ComfyUI-Data-Analysis data-analysis
pip install -r requirements.txt

Then restart ComfyUI and reload the browser. The requirements are pandas, matplotlib, seaborn, scipy, scikit-learn, openpyxl, and lxml - heavier than the average image-gen node pack, but they install cleanly. No model files, no GPU requirement, and note that since March 2025 the PyTorch wrapper nodes moved to a separate extension, so you don't need that one for anything in this article.

Gotchas

The main trap is the NaN behavior above - don't be surprised when missing values all show up as True. Also keep in mind this compares every cell, including ones you'd rather ignore (like a label column). If your data has string columns and you compare against an int, pandas gives you True everywhere in those columns, which is technically correct and almost never what you wanted. Select the numeric columns first with Pandas Select Columns and you'll dodge that.

CategoryData Analysis

Inputs (2)

NameTypeDefaultDescription
dataframeDATAFRAME
numberINT0-2147483648–2147483648

Outputs (1)

NameTypeDescription
DATAFRAMEDATAFRAME