Pandas Create Series From List Index List
A Series with labels you actually chose
- data
- index
- PDSERIES
Most of the time a default index is fine. When it isn't - when your data is monthly revenue and you want the index to read "Jan", "Feb", "Mar" instead of 0, 1, 2 - that's exactly what this node is for. It builds a pandas Series from two Python lists: one of values, one of index labels you supply.
It's the more opinionated sibling of Pandas Create Series From List, which gives you the auto-generated 0..n-1 index. This one lets you name your rows, and if you're about to plot or join, meaningful labels make the difference between a chart you can read and a chart that's technically correct and completely opaque.
It belongs to ComfyUI-Data-Analysis, HowToSD's pack that wraps Pandas (and Numpy, Matplotlib, Seaborn) into ComfyUI nodes so you can do real tabular work in the graph instead of in a script.
How it works
The implementation is honest and thin: it calls pd.Series(data, index=index). Both inputs are plain Python lists (PYLIST sockets), and the output is a PDSERIES - the pack's custom socket type for a pandas Series. Two behaviors worth knowing: an empty data list returns an empty Series, and a non-list input raises a ValueError rather than failing silently.
Inputs and outputs
- data (required,
PYLIST) - the cell values, in order. - index (required,
PYLIST) - the labels, one per value. - PDSERIES output - the resulting Series, ready for arithmetic nodes, selection nodes, or a show node.
The subtle bit for beginners: where do these PYLIST inputs come from? ComfyUI has no native "list" widget, so the pack's convention is to feed lists as JSON text. The clean way is CDA JSON Create - type ["Jan","Feb","Mar"] (valid JSON) into its multiline field, and it hands you a parsed string the list sockets accept. That pairing is the intended pattern, and the pack's user guide explicitly recommends CDA JSON Create for "a node that requires a list of integers for input."
A realistic flow
- CDA JSON Create with
[1.2, 3.4, 5.6]→ data. - CDA JSON Create with
["A","B","C"]→ index. - Wire both into this node, then run the Series into Pandas Show Series to confirm, or into an arithmetic node like Pandas Mul Series.
Keep the two lists the same length - pandas will throw its standard alignment error if they aren't, and the error text isn't always friendly inside ComfyUI's log.
Installing it
You get it with the whole pack. ComfyUI Manager: search "Data analysis", install ComfyUI-Data-Analysis, restart, reload the tab. Manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/HowToSD/ComfyUI-Data-Analysis
mv ComfyUI-Data-Analysis data-analysis # README: examples expect this folder name
pip install -r data-analysis/requirements.txt
The real dependencies are pandas and friends (matplotlib, seaborn, scipy, scikit-learn, openpyxl, lxml) - none of which base ComfyUI ships. No GPU, no model files. Since the March 2025 split, the PyTorch-tensor nodes live in a separate ComfyUI-Pt-Wrapper extension, so this pack stays CPU-only.
Gotchas
- List inputs aren't typed in the UI. You must construct them elsewhere (CDA JSON Create, or Py String To List). Trying to paste
[1,2,3]into a node's text field won't populate aPYLISTsocket. - Mismatched lengths fail at the pandas layer with a verbose error - check your two lists first.
- A non-list
datainput raises aValueError; JSON create always outputs a string, so route through it.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| data | PYLIST | — | |
| index | PYLIST | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| PDSERIES | PDSERIES | — |