Nodes/ComfyUI-Data-Analysis/Pandas Iat Set String
ComfyUI Node

Pandas Iat Set String

Overwrite one text cell, the un-pandas way

By HowToSD·Created 2 years ago·Updated about a year ago· 23
Pandas Iat Set String
  • dataframe
  • DATAFRAME
row_integer_position0
column_integer_position0
data

You loaded a CSV, spotted one bad label - a name spelled wrong, a category that should say "OnSale" instead of "onsale" - and you don't want to regenerate the whole file. PandasIatSetString writes a string into one specific cell of a DataFrame, at the row and column position you choose. It's the text version of the pack's cell-editing family, and it's the one you'll reach for when a single string is throwing off a filter or a group-by.

It comes from HowToSD's ComfyUI-Data-Analysis pack - Hide Inada's set of pandas/matplotlib/seaborn wrappers that turns ComfyUI into a visual data pipeline. No GPU, no model files, just pandas calls wrapped in nodes.

How it works

The mechanism is one line: dataframe.iat[row_integer_position, column_integer_position] = data. .iat is pandas' position-based accessor, so you're addressing the cell by physical position - 0-based row, 0-based column - not by row label or column name. This mirrors the rest of the iat/iloc family in the pack, so if you've used any of them, this feels identical. The string is written in place and the same DataFrame comes back out.

The data input is a plain STRING widget, default empty. No conversion nodes needed - you literally type the replacement text.

The inputs that matter

  • dataframe - what you're fixing.
  • row_integer_position / column_integer_position - default to 0, and 0-based. This is where people burn themselves: forget to set them and you've just overwritten cell [0, 0].
  • data - the replacement string.

One DATAFRAME out, wire it into a show node to confirm.

Installing it

The standard song for this pack. Easiest via ComfyUI Manager: search "ComfyUI-Data-Analysis", install, restart. Manager installs the requirements (pandas, matplotlib, seaborn, scipy, scikit-learn, openpyxl, lxml) automatically. Manual:

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

The README's one wrinkle: rename the folder to data-analysis after cloning, or the example workflows won't load their files. Also worth knowing up front: this pack has a custom non-commercial license - personal and academic use is fine, commercial use needs the author's written permission.

Gotchas

The in-place edit is the main behavior to internalize: the node mutates the DataFrame you hand it and passes the same object forward, so other branches fed by the same dataframe see the change. And while writing a string into a string column is harmless, writing one into a numeric column silently upcasts that column to object dtype - which then breaks mean/agg operations later. Position mistakes give you an IndexError, which is at least honest. Keep this node for genuine single-cell text fixes and you'll wonder how you ever edited CSVs by hand before.

CategoryData Analysis

Inputs (4)

NameTypeDefaultDescription
dataframeDATAFRAME
row_integer_positionINT00–2147483648
column_integer_positionINT00–2147483648
dataSTRING

Outputs (1)

NameTypeDescription
DATAFRAMEDATAFRAME