Pandas Iat Set Datetime
Poke a datetime into any cell of a DataFrame
- dataframe
- data
- DATAFRAME
So you've got a pandas DataFrame in your ComfyUI graph and one cell is wrong - a date that parsed as a string, or a timestamp that came in as something useless. This node is the surgical fix: it drops a real Python datetime.datetime into one specific cell, at a row and column position you pick.
PandasIatSetDatetime is part of the HowToSD ComfyUI-Data-Analysis pack, Hide Inada's set of wrappers that brings pandas, matplotlib, and seaborn into the node graph. The whole pack is about treating ComfyUI like a data-pipeline builder instead of just an image generator, and this node is squarely in the "fix one thing, keep the rest" category. No GPU involved, no model downloads - just pandas doing what pandas does.
How it works
Under the hood it's a one-liner: dataframe.iat[row_integer_position, column_integer_position] = data. .iat is pandas' position-based cell accessor - it indexes by integer position, not by row label, so row 0 is the first row regardless of what the index says. It writes the value in place and hands the same DataFrame back out.
The interesting bit is the data input. It's a PYDATETIME type, which you can't type into a widget. You get it from a companion node in the same pack - PyStringToDatetime (under Python wrapper) takes a string plus a strftime format like %Y-%m-%d %H:%M:%S and produces the datetime you wire in here. There's also PyDatetimeToString on the way out if you need to read it back as text.
The inputs that matter
- dataframe - what you're editing. Straight in from any node that outputs a DATAFRAME.
- row_integer_position and column_integer_position - both default to 0. This is the trap: the default silently edits cell [0, 0] if you forget to set them.
- data - the PYDATETIME value, from PyStringToDatetime.
The single output is the modified DATAFRAME. Because it's the same object, wire it onward to a show/save node to confirm the edit landed.
Installing it
ComfyUI Manager is the easy path: search "ComfyUI-Data-Analysis" (or "Data analysis"), hit Install, restart ComfyUI. It pulls in the requirements - pandas, matplotlib, seaborn, scipy, scikit-learn, openpyxl, lxml - automatically. Git install is the same story as every node in this pack:
cd ComfyUI/custom_nodes
git clone https://github.com/HowToSD/ComfyUI-Data-Analysis.git
pip install -r requirements.txt
The README adds one quirk: rename the cloned folder to data-analysis, or the example workflows won't find their files. And one licensing note worth knowing before you build a business on it - this pack ships under a custom non-commercial license, so personal/academic use is fine, commercial use needs written permission.
Gotchas
The biggest one: this node mutates the DataFrame in place. If the same dataframe feeds two branches and you edit it on one, the other branch sees the edit. In most ComfyUI runs that's fine (each run rebuilds from the loaders), but if you're caching nodes, keep an eye on it.
Also remember positions are 0-based and bounds-checked by pandas - feed it a row past the end and you'll get an IndexError that fails the whole run. Get your row and column right, and this is one of the handiest little "oops, fix that one date" nodes in the pack.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| dataframe | DATAFRAME | — | |
| row_integer_position | INT | 00–2147483648 | — |
| column_integer_position | INT | 00–2147483648 | — |
| data | PYDATETIME | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| DATAFRAME | DATAFRAME | — |