Pandas Div Scalar Float
Scale a whole table by one number
- dataframe
- DATAFRAME
Pandas Div Scalar Float is the "divide everything by a number" node - the kind of operation that shows up constantly and barely deserves a node to itself, except that in a node graph, every operation needs to be a node. Normalize raw counts by a total, convert pixels to fractions, rescale a column from one unit to another: feed in a DataFrame and a float, get back the whole frame divided by it.
Mechanism is exactly as advertised:
df_out = dataframe / float_scalar
Inputs: dataframe (DATAFRAME) and float_scalar (FLOAT). The float default is 1.0 (a no-op until you change it), with a range of roughly ±2^31, which is plenty for anything you'd scale by. Output is a DATAFRAME of the same shape - every cell divided by the scalar, cell-by-cell, no alignment games because there's nothing to align with.
The important mental note is what this node is not doing: it's not DataFrame.div with alignment, it's a plain elementwise /. No NaN surprises from misaligned labels, no index matching - just a table and a number. That makes it the division node you reach for first, and you should: most "divide my data" problems are scalar problems.
Where it fits, and what to watch
This is the sibling of Pandas Div Scalar Int. The float version exists so you can divide by 0.5, 2.5, 100.0 - anything fractional. If your divisor is always a whole number, either works, but the float node keeps the type story honest. The classic trap is dividing by zero: float_scalar = 0 gives you a frame full of inf (and NaN where 0/0), not an error. The node has no guard against it, so double-check the field before you run or you'll be debugging invisible infinities in your plots.
The other honest limitation: it divides every column, including ones that maybe shouldn't be touched. If your DataFrame mixes numeric columns with categorical text, dividing will try to divide everything - pandas will error on the text columns or leave them alone depending on dtype. In practice you'll want to select the numeric columns first, or keep the frame numeric-only.
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 → restart. No GPU, no models. This whole pack is CPU-only pandas/NumPy, which means it installs fast and runs anywhere ComfyUI does.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| dataframe | DATAFRAME | — | |
| float_scalar | FLOAT | 1.00-2147483648–2147483648 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| DATAFRAME | DATAFRAME | — |