ComfyUI Node

Pandas At Int

Pull one integer out of a DataFrame by label

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

Pandas At Int is the integer member of the Pandas At family: it reaches into a DataFrame, grabs one cell by its row index and column label, and hands it out as a plain INT. Same job as Pandas At Float, but for whole numbers - and that matters when the thing you're pulling is itself an index, a count, or a value that other nodes expect to be an integer.

How it works

dataframe.at[row_index, column_label], returned as an int. Label-based single-cell access from pandas' .at method - fast, exact, and it raises a KeyError if the label doesn't exist rather than silently giving you garbage. You specify the location with two text fields plus two type enums (row_index_type and column_label_type, each string or int) that tell the node whether to cast your typed label to an integer.

Inputs and outputs

  • dataframe - the frame to read (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
  • Output: INT

When you'd reach for it

Indexes and counts are the natural fit: pull a row number, a batch size, or a winner's score out of a results table and feed it into something that wants an INT - loop counts, scalar parameters, even sampling steps if you're feeling chaotic. It's also the natural companion to the setter nodes: read a value, adjust it, write it back with Pandas At Set Int. If your cell is fractional, use Pandas At Float instead - this node will happily truncate it to int, and that's rarely what you meant.

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; pandas comes from requirements.txt (Manager installs it automatically).

The usual mistakes

Same label-mismatch trap as the rest of the family - if row_index_type is string but your index is integers, you'll get KeyErrors all day. And remember it's label-based, not positional: the "third row, second column" use case belongs to Pandas Iat Int. If the cell contains text, the int conversion will throw; run the column through Pandas As Int first to be safe.

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
INTINT