ComfyUI Node

Pandas Eq

The == operator of your data graph

By HowToSD·Created 2 years ago·Updated about a year ago· 23
Pandas Eq
  • a_dataframe
  • b_dataframe
  • DATAFRAME

Pandas Eq is the == operator turned into a node. You feed it two DataFrames and it compares them element by element, producing a new DataFrame where every cell is True or False depending on whether the two inputs matched. It's a workhorse of the comparison family in the ComfyUI-Data-Analysis pack (the Eq/Ge/Gt/Le/Lt gang), and like all of them its real job is making boolean masks you can act on.

Why would you bother? Say you loaded two CSV exports of the same table and want to see where they disagree. Wire both into Pandas Eq, push the result through a show node, and every mismatch lights up as False. Or use it to build a mask: the pack's Pandas Boolean Index node takes a boolean result exactly like this and filters rows with it. That's the classic pattern - compare, get a mask, filter.

How it works

Under the hood it's one pandas call: a_dataframe.eq(b_dataframe). The output keeps the shape, row labels, and column labels of the left frame, with each cell replaced by the comparison result. The values are real booleans, not 0/1 - don't try to sum them directly expecting a count of matches; that's what Pandas Count or a cast node is for.

Two pandas quirks to know before you trust the output. First, alignment: pandas aligns on row and column labels, so if the two frames have different indexes, you get NaN wherever they don't line up - and NaN in a comparison result is neither True nor False, it's just missing. Second, NaN never equals NaN. If both files have a blank cell in the same spot, that cell comes out False, which reads as "mismatch" even though both sides are equally empty. For most data that's fine, but it's the kind of thing that makes you stare at a result wondering what's wrong.

Inputs and outputs

  • a_dataframe (required, DATAFRAME) - the left frame.
  • b_dataframe (required, DATAFRAME) - the right frame.
  • DATAFRAME output - the boolean result, ready to feed Pandas Boolean Index, Pandas Show DataFrame, or another comparison.

That DATAFRAME socket is the pack's own JSON-string type, not a native ComfyUI type. When you drag a wire from a pandas node, aim at the top-left corner of the target's socket - the pack's user guide warns the connection point is easy to miss.

Installing it

Same install for every node here - it's one pack. In ComfyUI Manager, search "Data analysis" and install ComfyUI-Data-Analysis, restart, reload the browser. Manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/HowToSD/ComfyUI-Data-Analysis
mv ComfyUI-Data-Analysis data-analysis   # README insists on this folder name
pip install -r data-analysis/requirements.txt

The requirements file pulls in pandas, matplotlib, seaborn, scipy, scikit-learn, openpyxl and lxml - none of which ship with base ComfyUI, and pandas is the non-negotiable one here. No GPU, no model downloads; this is pure CPU data work.

CategoryData Analysis

Inputs (2)

NameTypeDefaultDescription
a_dataframeDATAFRAME
b_dataframeDATAFRAME

Outputs (1)

NameTypeDescription
DATAFRAMEDATAFRAME