Nodes/ComfyUI-Data-Analysis/Pandas At Set Int
ComfyUI Node

Pandas At Set Int

Write one integer into a cell and hand the frame back

By HowToSD·Created 2 years ago·Updated about a year ago· 23
Pandas At Set Int
  • dataframe
  • DATAFRAME
row_index
row_index_type
column_label
column_label_type
data0

Pandas At Set Int is the integer setter in the Pandas At write family: it finds one cell by row and column labels and overwrites it with an integer, returning the edited DataFrame. If Pandas At Set Float covers numeric patches generally, this one is for when the value really must be a whole number - row counts, indices, IDs.

How it works

dataframe.at[row_index, column_label] = data, pandas' label-based single-cell assignment. Four location inputs (row label, column label, plus a string/int type enum for each) and an INT data input. The frame comes back with the cell replaced.

Same in-place caveat as the rest of the setter family: the docs state outright that this modifies the input DataFrame in place. pandas .at assignment edits the existing object, so other nodes wired to the same DataFrame output can observe the change depending on graph order. For typical small graphs you'll never notice; for big ones, don't place a setter in the middle of a busy shared branch.

Inputs and outputs

  • dataframe - the frame to edit (DATAFRAME)
  • row_index - the row's label (STRING)
  • row_index_type - string or int
  • column_label - the column's label (STRING)
  • column_label_type - string or int
  • data - the integer to write, default 0 (INT)
  • Output: DATAFRAME

When it earns its place

The read-modify-write loop, mostly: pull a value with Pandas At Int, adjust it in an arithmetic node, write the corrected integer back. Fixing a miscounted row in a loaded CSV without reloading the file. Setting a known ID or rank into a results table. It's a small node for a small job, but the pack is deliberately built out of these small, composable pieces - you stack them.

Installing it

Ships with ComfyUI-Data-Analysis (author Hide Inada / HowToSD.com). Manager: search Data Analysis → install → restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/HowToSD/ComfyUI-Data-Analysis.git
mv ComfyUI-Data-Analysis data-analysis
pip install -r data-analysis/requirements.txt

No GPU needed; pandas comes from requirements.txt.

Gotchas

The label-type enum is the recurring family trap - wrong string/int choice and the lookup KeyErrors. It's label-based, not positional, so the "row 3, column 2" case belongs to Pandas Iat Set Int. And if your target column holds floats, writing an int into it is fine, but the column may keep its float dtype - pandas will happily store 5 as 5.0-ish; convert the column with Pandas As Int if the dtype actually matters downstream.

CategoryData Analysis

Inputs (6)

NameTypeDefaultDescription
dataframeDATAFRAME
row_indexSTRING
row_index_typeCOMBO2 options: string, int
column_labelSTRING
column_label_typeCOMBO2 options: string, int
dataINT0-2147483648–2147483648

Outputs (1)

NameTypeDescription
DATAFRAMEDATAFRAME