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

Pandas At Set Float

Patch one cell with a number, in place

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

Sometimes you don't need a whole new table. You need to fix one number in the one you've got. Pandas At Set Float finds a single cell by row and column labels and overwrites it with a float - then hands the edited DataFrame back. It's the write-side counterpart to Pandas At Float, and it's the smallest possible "edit one value" tool in the pack.

How it works

The mechanism is dataframe.at[row_index, column_label] = data. You describe the target with the usual four inputs - row label, column label, and a string/int type switch for each - and supply the new value via the data FLOAT input. The node returns the frame with the cell replaced.

And the footnote that matters: this modifies the input DataFrame in place. pandas .at assignment edits the existing object rather than copying it, and the author says so explicitly in the docs. In a graph, any node reading from the same DataFrame output can see the change depending on execution order. For a simple workflow it's a non-issue; for a sprawling one, be deliberate about where the setter sits.

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 float to write, default 0 (FLOAT)
  • Output: DATAFRAME

When you'd reach for it

Correcting a bad value in a loaded table without rebuilding it; writing a computed result back into a results frame; or rounding out the read-modify-write loop - read with Pandas At Float, transform in a math node, write back here. It's niche, but when you need it, you need it, because the alternative is reconstructing the whole DataFrame.

Installing it

Part of ComfyUI-Data-Analysis (Hide Inada / HowToSD.com). Manager: search Data Analysis → install → restart. Manual:

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; pandas comes via requirements.txt.

Gotchas

Same family theme: wrong label type enum → KeyError; label-based (not positional), so "third row, second column" wants Pandas Iat Set Float instead. And keep the in-place mutation in mind - if the same frame feeds other branches, place this node at the end of the line or accept that everything downstream sees the patched value.

CategoryData Analysis

Inputs (6)

NameTypeDefaultDescription
dataframeDATAFRAME
row_indexSTRING
row_index_typeCOMBO2 options: string, int
column_labelSTRING
column_label_typeCOMBO2 options: string, int
dataFLOAT0-9223372036854776000–9223372036854776000

Outputs (1)

NameTypeDescription
DATAFRAMEDATAFRAME