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

Pandas Iat Datetime

Pull one datetime cell out of your table

By HowToSD·Created 2 years ago·Updated about a year ago· 23
Pandas Iat Datetime
  • dataframe
  • PYDATETIME
row_integer_position0
column_integer_position0

Pandas Iat Datetime reaches into a DataFrame, grabs a single cell by its row and column position, and hands it back to you as a Python datetime.datetime. "Iat" is pandas' iat accessor - integer-based, positional cell lookup - and this node is the datetime-flavored member of the Iat family, next to Pandas Iat Float and Pandas Iat Int.

Why would you want a single date out of a table? Because sometimes a whole DataFrame is overkill and you need one value as a proper typed object to feed another node - a "generated on" date, a reference timestamp, the latest entry's date. In the pack's model, this is the node that bridges "table" land into "scalar" land: instead of carrying an entire frame downstream, you extract the one value that matters. There's a sibling trio of At nodes (Pandas At Datetime and friends) that does the same lookup by row/column label instead of position - pick At when you know the names, Iat when you know the positions (or when your data has no meaningful labels).

How it works

It calls dataframe.iat[row_integer_position, column_integer_position] and then .to_pydatetime() on the result. The important mechanical detail is that to_pydatetime() only exists on pandas Timestamp objects - so the cell you point at needs to hold a datetime (a pandas Timestamp or an actual datetime.datetime), otherwise the node errors. If your dates are sitting in the frame as strings, run Pandas To Datetime first to convert the column, then extract. If the cell is NaN or empty, that also crashes - you can't convert a missing value to a datetime.

Positional means 0-based and brittle in the usual way: row 0, column 0 is the top-left cell, and if your frame gets reordered by a sort or a group-by, the positions change even though the data is the same. That's why the label-based At nodes exist. Use Iat when you're working with a fresh, stable frame and you know exactly where the value lives.

Inputs and outputs

  • dataframe (required, DATAFRAME) - the frame to look into.
  • row_integer_position (required, INT, default 0) - the 0-based row.
  • column_integer_position (required, INT, default 0) - the 0-based column.
  • PYDATETIME output - the cell as a Python datetime.datetime, ready for datetime-aware nodes (or the pack's string/format nodes).

Installing it

Same pack install as every node here. ComfyUI Manager → search "Data analysis" → install ComfyUI-Data-Analysis → restart → reload. Manual:

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

Requirements: pandas, matplotlib, seaborn, scipy, scikit-learn, openpyxl, lxml. No GPU, no model downloads. If you get an error on this node, it's almost never the install - it's a cell that isn't a real datetime. Convert the column with Pandas To Datetime first and you're set.

CategoryData Analysis

Inputs (3)

NameTypeDefaultDescription
dataframeDATAFRAME
row_integer_positionINT00–2147483648
column_integer_positionINT00–2147483648

Outputs (1)

NameTypeDescription
PYDATETIMEPYDATETIME