Nodes/ComfyUI-Data-Analysis/Pandas Create From Numpy
ComfyUI Node

Pandas Create From Numpy

Hand your arrays to pandas without the round-trip

By HowToSD·Created 2 years ago·Updated about a year ago· 23
Pandas Create From Numpy
  • data
  • DATAFRAME

Pandas Create From Numpy is the bridge node between the pack's NumPy side and its pandas side. You feed it an NDARRAY - a NumPy array produced by one of the pack's Numpy Float Create / Numpy Int Create nodes, or anything else emitting the pack's NDARRAY type - and out comes a DATAFRAME. No serialization, no CSV round-trip, no typing anything twice. It's the clean seam between "I have an array" and "I want to run pandas over it."

Mechanically it's one line:

return (pd.DataFrame(data),)

The only real rule is dimensionality: the node accepts rank 1 and rank 2 arrays only. A rank 1 array becomes a single-column DataFrame; a rank 2 array becomes rows and columns. Anything rank 3 or higher raises a ValueError with a clear message, because a higher-dimensional array has no obvious tabular shape. If you hit that, squeeze the array down first with the pack's Numpy Squeeze node (or reshape upstream) before it reaches this node.

Inputs and outputs are exactly as advertised: required data (NDARRAY), output DATAFRAME. There's nothing else to configure, which is the point - it's a type-conversion node, and it stays out of your way.

One thing to internalize: pandas infers the column labels automatically (integers 0..n for rank 2). If you need named columns, you'll be renaming afterward or building your data as a dict instead. For quick analysis of array-shaped data - a computed feature vector, a squeezed batch dimension, output from a NumPy math node - this is the fastest hop into DataFrame-land, where you can then show it, plot it, or feed the rest of the analysis nodes.

Install

Same as every node in this pack - it isn't in base ComfyUI:

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

or via ComfyUI Manager (search "Data analysis") and restart. No GPU, no model downloads. NumPy, pandas, matplotlib, seaborn and friends get pulled in by requirements.txt - if Manager's install half-fails, pip install pandas numpy manually and you're set.

CategoryData Analysis

Inputs (1)

NameTypeDefaultDescription
dataNDARRAY

Outputs (1)

NameTypeDescription
DATAFRAMEDATAFRAME