Pandas At Set Int
Write one integer into a cell and hand the frame back
- dataframe
- DATAFRAME
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-stringorintcolumn_label- the column's label (STRING)column_label_type-stringorintdata- 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.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| dataframe | DATAFRAME | — | |
| row_index | STRING | — | |
| row_index_type | COMBO | 2 options: string, int | |
| column_label | STRING | — | |
| column_label_type | COMBO | 2 options: string, int | |
| data | INT | 0-2147483648–2147483648 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| DATAFRAME | DATAFRAME | — |