Nodes/ComfyUI-Data-Analysis/Pandas Select Column As Series
ComfyUI Node

Pandas Select Column As Series

Pandas Select Column As Series

By HowToSD·Created 2 years ago·Updated about a year ago· 23
Pandas Select Column As Series
  • dataframe
  • PDSERIES
column_name

In pandas-land, a column isn't just data - it's a Series, a one-dimensional object with its own methods and its own socket type in this pack. Pandas Select Column As Series is how you pull a single column out of a DataFrame and hand it to the nodes that want a PDSERIES on their input: series math like Pandas Pow Series, conversion nodes like Pandas Series To DataFrame, or display nodes that render it as text. If you see a node complaining it wants a PDSERIES, this is almost always the node that produces it.

It's from HowToSD/ComfyUI-Data-Analysis, and it's grouped in the pack's Data subset selection category alongside Select Columns (which keeps everything as a DataFrame). The distinction is the whole point: keep it a table if you want table-shaped output, or peel it into a Series when a downstream node needs the one-dimensional form.

How it works

The mechanism is delightfully plain: dataframe[column_name]. Give it the exact column name and pandas returns that column as a Series. Note the type - column_name is a STRING field, so you type the label rather than picking from a dropdown, and it must match exactly (case, spaces, all of it). Get it wrong and pandas raises a KeyError, which the node doesn't catch, so the workflow errors loudly rather than producing garbage.

Inputs and output

  • dataframe - the source table.
  • column_name - the exact column label, as a STRING.

Output: a single PDSERIES. From here you can convert it back to a DataFrame (Pandas Series To DataFrame), stringify it for display (Pandas Series To String), or use it as the exponent in Pandas Pow Series. The node name says "one" and it means it - no comma-separated lists here.

Installation

Standard pack install. ComfyUI Manager: search Data analysis, install ComfyUI-Data-Analysis. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/HowToSD/ComfyUI-Data-Analysis.git
mv ComfyUI-Data-Analysis data-analysis   # examples need this folder name
pip install -r requirements.txt

Restart, reload. Deps: pandas, matplotlib, seaborn, scipy, scikit-learn, openpyxl, lxml - no GPU, no model downloads.

The gotcha: exact names

Since the field is free text rather than a dropdown, typos and trailing spaces are on you. If your DataFrame has a column literally named "score " (trailing space, thanks CSV import), typing score raises KeyError. Run a Pandas Show DataFrame or Columns node first and copy the label verbatim. Also worth knowing: the Series keeps the DataFrame's index, which matters when you combine it with other series - pandas aligns on index labels, so mismatched indexes produce NaN in the merged result.

CategoryData Analysis

Inputs (2)

NameTypeDefaultDescription
dataframeDATAFRAME
column_nameSTRING

Outputs (1)

NameTypeDescription
PDSERIESPDSERIES