Pandas Add
Add two DataFrames cell by cell — alignment included, no matrix math
- a_dataframe
- b_dataframe
- DATAFRAME
If you've got two tables sitting in the same graph - say a forecast and a baseline, or a measurement and a correction factor - and you want them combined position-by-position, this is the node. Pandas Add takes two DataFrames and adds them element-wise, producing a third. It's the arithmetic baseline that the rest of the pack's math nodes hang off, and once you've used it once, PandasSub, PandasMul and friends are free.
How it works
The node calls a_dataframe.add(b_dataframe). That's plain pandas element-wise addition: cell [row, col] of the output is a[row, col] + b[row, col]. The part that trips people up is alignment. pandas doesn't add by position - it aligns on the row index and column labels. Two identically-shaped tables with the same labels add cleanly. Two tables whose indexes or columns don't line up produce NaN at every mismatched cell, not an error. So a silently half-empty result usually means your labels drifted somewhere upstream.
Also worth knowing: this is not matrix multiplication, and it's not row/column vector math. It's strictly per-cell.
Inputs and outputs
a_dataframe- left DataFrame (DATAFRAME)b_dataframe- right DataFrame (DATAFRAME)- Output: a single
DATAFRAMEwith the element-wise sum
That's the whole interface. Feed it two frames from Pandas Load CSV, Pandas Create, or the output of any other arithmetic node, and wire the result onward - into a plot, a Pandas Show DataFrame, or another math step.
Installing it
It's part of ComfyUI-Data-Analysis by Hide Inada (HowToSD.com), which is in the Comfy Registry, so Manager handles it:
- Manager → Custom Node Manager → search Data Analysis → install ComfyUI-Data-Analysis → restart → reload the page.
Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/HowToSD/ComfyUI-Data-Analysis.git
mv ComfyUI-Data-Analysis data-analysis # author requires this exact folder name for example workflows
pip install -r data-analysis/requirements.txt
Then restart ComfyUI. No GPU needed - this is all CPU pandas. Manager pulls pandas, matplotlib, seaborn, scipy and scikit-learn for you; stock ComfyUI doesn't ship them, so the manual path needs that pip install step.
Where people get burned
The alignment trap above is the main one. Second: string columns. If either frame has non-numeric columns, add raises a TypeError and the node fails loudly. Run Pandas As Float on the frame first if you're summing a mixed bag, or make sure you're only adding numeric columns.
One more thing to expect: this is a genuinely boring node, and that's a compliment. When your graph has grown a second branch and you need to merge two computed tables, it's exactly the tool - small, dumb, and it does the one thing. The author frames the whole pack as turning ComfyUI into a visual data-science scratchpad (it's part of the "Data Analysis" menu after install), and Add is the connective tissue between all the clever nodes around it.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| a_dataframe | DATAFRAME | — | |
| b_dataframe | DATAFRAME | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| DATAFRAME | DATAFRAME | — |