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

Pandas Div Scalar Int

Integer-scaled division when you know the number is whole

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

Pandas Div Scalar Int divides an entire DataFrame by one integer - the whole table scaled by a single whole number. It's the "clean" version of the scalar division pair: if your divisor is always an integer like 100, 1000, or 60, this node exists so you don't have to feed a float where an int belongs. Divide raw counts by 1000 to get thousands, split a batch metric per-item, convert a per-100k rate into a plain fraction - all one-node jobs.

The mechanism is the same elementwise operation as the float twin:

df_out = dataframe / int_scalar

Inputs: dataframe (DATAFRAME) and int_scalar (INT, default 1, range ±2^31). Output: a same-shaped DATAFRAME. And this is true division, not integer floor division - pandas / produces floats, so [3, 4] / 2 gives you [1.5, 2.0], not [1, 2]. If you were expecting integer division to keep whole numbers, that's the one surprise baked into the implementation.

The honest take on the int vs. float split

The pack ships both Div Scalar Int and Div Scalar Float, and functionally they're interchangeable - the underlying operation is identical, only the input widget type differs. The int version is the better habit when the number genuinely is whole, because it keeps the graph self-documenting: anyone reading your workflow sees the divisor is an integer by construction. It also gives you a clean integer widget in the UI instead of a float spinner. That's the whole difference, and it's fine.

Same warnings as the float version apply. Zero divisor → a frame of inf (and NaN for 0/0), silently, no error. And dividing a mixed table with text columns will trip over non-numeric data - keep the frame numeric or select columns first.

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 model downloads - pandas is the entire dependency that matters here, and requirements.txt installs it.

CategoryData Analysis

Inputs (2)

NameTypeDefaultDescription
dataframeDATAFRAME
int_scalarINT1-2147483648–2147483648

Outputs (1)

NameTypeDescription
DATAFRAMEDATAFRAME