Pandas Exp
E^x across your whole table, with strings safely out of the way
- dataframe
- DATAFRAME
Pandas Exp applies the exponential function to every numeric cell in a DataFrame. exp(0) = 1, exp(1) ≈ 2.718, exp(2) ≈ 7.389 - the whole frame gets run through e^x. It's a math node, and if that sounds boring, you're right, but it's also the node you reach for when your data is counts or ratios and you need to work in a transformed space where the math behaves.
When does that actually come up? When your target metric is log-scaled. If a column stores log(something) - very common with price data, particle counts, or any quantity that spans orders of magnitude - running it through exp gets you back the real values. It's also the inverse partner of the pack's Pandas Log node: log then exp is a round trip that takes you to linear space, do your arithmetic, and come back. In a ComfyUI graph that becomes a chain of three nodes, which is the whole point of this pack - doing in visual wiring what you'd otherwise need a notebook for.
How it works
The implementation is worth reading closely because it's two steps, and the first step does something you should not forget: before applying np.exp, the node runs every column through pd.to_numeric(errors='coerce'). What that means in practice: any non-numeric values in the frame become NaN first. String columns, text flags, categorical labels - all silently converted to missing, then exp(NaN) stays NaN. So the node doesn't crash on a mixed DataFrame; it just produces NaN everywhere the data wasn't numeric to begin with.
Two consequences. First, it's safer than it looks - you can feed it a frame with a text column and get a result instead of an exception. Second, that result has a poisoned column full of NaN, and downstream aggregations will spread it. If you don't want text columns in your output, split them off with Pandas Horizontal Split before the exp, or accept the NaN and clean up after with Pandas Drop NA.
Also note the overflow behavior: exp grows fast, and values above roughly 709 overflow a 64-bit float to inf. A column of year-of-birth values isn't getting exponentiated meaningfully anyway, but if you have large integers in the frame, you'll see infinities where you didn't expect them.
Inputs and outputs
- dataframe (required,
DATAFRAME) - any frame; strings get coerced toNaN. - DATAFRAME output - the element-wise
exp, with non-numeric cells asNaN.
Installing it
Same pack install as everything else here. ComfyUI Manager: search "Data analysis", install ComfyUI-Data-Analysis, restart, reload. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/HowToSD/ComfyUI-Data-Analysis
mv ComfyUI-Data-Analysis data-analysis
pip install -r data-analysis/requirements.txt
Requirements: pandas, matplotlib, seaborn, scipy, scikit-learn, openpyxl, lxml. No GPU, no model downloads - pure CPU. If the node errors on import or run, it's almost always that pandas/numpy didn't install cleanly via requirements, since base ComfyUI ships neither pandas nor matplotlib.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| dataframe | DATAFRAME | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| DATAFRAME | DATAFRAME | — |