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

Pandas At Set Datetime

Write a datetime into a specific cell — and know it mutates

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

The Pandas At family reads cells. Pandas At Set Datetime writes one. It takes a DataFrame, finds a single cell by row and column labels, and replaces it with a Python datetime - then hands the (modified) frame back out. It's the "write this timestamp into the table" node, the inverse of Pandas At Datetime.

How it works

The mechanism is dataframe.at[row_index, column_label] = data, pandas' label-based single-cell assignment. You point at the cell with four inputs - row label, column label, and a string/int type switch for each - and the data input supplies the datetime. The node then returns the DataFrame with the cell updated.

Here's the part the docs call out explicitly: this modifies the input DataFrame in place. pandas .at assignment mutates the object rather than making a copy. In ComfyUI terms, that means any other node reading the same DataFrame output upstream can see the mutation too, depending on execution order. The returned frame is the same object, just edited. It usually works out fine in a simple graph, but it's the kind of thing that bites you in a big workflow, so it's worth knowing.

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 datetime to write (PYDATETIME)
  • Output: DATAFRAME

When you'd reach for it

Anytime a table needs a timestamp patched in from elsewhere in the graph - record "processed at this time" into a results frame, overwrite a stale date, or set a cell from a datetime that came out of Py String To Datetime or another Pandas At Datetime. You read, you transform, you write back: that read-modify-write loop is exactly what this node completes.

Installing it

Part of ComfyUI-Data-Analysis (author 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 needed; pandas comes from requirements.txt.

Gotchas

The in-place mutation is the big one - if two downstream branches depend on the same frame, be deliberate about where you place the setter. Label mismatch (string vs int) is the other classic; wrong enum and you'll get a KeyError. And the data input expects a real PYDATETIME, so wire in a datetime-producing node - a bare string won't fly.

CategoryData Analysis

Inputs (6)

NameTypeDefaultDescription
dataframeDATAFRAME
row_indexSTRING
row_index_typeCOMBO2 options: string, int
column_labelSTRING
column_label_typeCOMBO2 options: string, int
dataPYDATETIME

Outputs (1)

NameTypeDescription
DATAFRAMEDATAFRAME