Pandas At Datetime
Pluck one datetime out of a table by its row and column labels
- dataframe
- PYDATETIME
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:stringorint. Pickintwhen your row labels are integers, or the lookup will miss.column_label- the column's label (STRING)column_label_type- enum:stringorint, 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.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| dataframe | DATAFRAME | — | |
| row_index | STRING | — | |
| row_index_type | COMBO | 2 options: string, int | |
| column_label | STRING | — | |
| column_label_type | COMBO | 2 options: string, int |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| PYDATETIME | PYDATETIME | — |