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

Pandas At Datetime

Pluck one datetime out of a table by its row and column labels

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

Ever loaded a spreadsheet of timestamps into ComfyUI and wanted to grab one date out of it - the date this row shipped, the date that row was recorded - and hand it to the rest of the graph as an actual datetime? That's Pandas At Datetime. It reads a single cell out of a DataFrame by its row index and column label, and returns it as a Python datetime.datetime object (the pack's PYDATETIME type), ready to feed into datetime-aware nodes or display.

How it works

Under the hood it's dataframe.at[row_index, column_label], pandas' fast label-based cell accessor - the "at" in the name is literally the .at method. The node then converts whatever it finds to a Python datetime via .to_pydatetime(). Note the distinction that trips up newcomers: this looks up by label (your index and column names), not by position. If you want the Nth row, Nth column by position, that's the separate Pandas Iat family instead.

Inputs and outputs

The fiddly part is the four inputs that describe where the cell is:

  • dataframe - the frame to read (DATAFRAME)
  • row_index - the row's label, typed as text (STRING)
  • row_index_type - enum: string or int. Pick int when your row labels are integers, or the lookup will miss.
  • column_label - the column's label (STRING)
  • column_label_type - enum: string or int, same idea for columns
  • Output: PYDATETIME

Those type enums exist because ComfyUI gives you text boxes, but your index might be integer. The node casts your typed value to int when you tell it the label is int. Get this wrong and you'll silently get a KeyError - the labels just won't match.

When you'd reach for it

Anytime a single timestamp drives downstream behavior: pull "last updated" from a table and use it in a filename, compare two dates, or pipe a datetime into the pack's Py Datetime To String to render it into text. Combined with the Pandas At Set family, you can even read a value, transform it, and write it back.

Installing it

Comes with 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 (Manager installs it).

Where people get burned

The string/int label mismatch is the classic one - if row_index_type says string but your index is integers, every lookup KeyErrors. Also: the cell really needs to hold a datetime-like value; a plain string won't convert. Run the column through Pandas To Datetime first if your timestamps arrived as text. And be aware that .at with an exact label miss raises instead of returning NaN - which is honestly better, because it tells you immediately that your labels don't line up.

CategoryData Analysis

Inputs (5)

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

Outputs (1)

NameTypeDescription
PYDATETIMEPYDATETIME