Pandas Create From Dict
Build a DataFrame from a Python dict, the way ComfyUI can actually wire it
- data
- DATAFRAME
Pandas Create From Dict is the "programmer's way" to build a DataFrame inside this pack. Where Pandas Create parses text you typed, this one takes a proper Python dictionary - each key becomes a column, each value a list of cells - and turns it into a DATAFRAME. It exists because most ComfyUI users don't hand-type CSV; they want to construct data out of other nodes, and a dict is the natural bridge.
The thing to understand is what feeds it. The data input expects the pack's PYDICT wire type, which you won't have lying around unless you built one. The intended source is the pack's Py String To Dict node: type a dict literal like {"player": ["Mays", "Aaron"], "hits": [3600, 3771]} as text, and that node hands you a real dict object to plug in here. That string → dict → DataFrame chain is the canonical path for anyone who wants to enter data without a CSV loader.
What you set
One required input: data (PYDICT). One output: DATAFRAME. That's the whole node - it's deliberately thin.
There's a subtlety in how the index comes out. The code builds the frame with index=list(range(len)), so rows get a fresh 0-based RangeIndex regardless of what was in the dict. That's usually what you want for freshly-typed data. If you need meaningful row labels - player names as the index, say - you don't get them here. You'd either keep them as a normal column or step up to Pandas Create From Dict Index List, which takes an explicit index list.
Where people get burned
Empty dicts. Feed it an empty {} and you get an empty DataFrame back, silently - which is fine for "no data" branches in a workflow, but if you wired a default empty dict in and then wonder why downstream nodes show nothing, this is why. Also, dict values are expected to be equal-length lists. If one column has three rows and another has two, pandas raises an alignment error and the queue dies with a Python traceback. Check your lists.
The wiring tip applies here more than most nodes: PYDICT inputs are rendered as text widgets in the graph, and you connect into them at the top-left corner of the field, not the middle. Hover around the edge and the socket appears. This catches basically everyone the first time.
Installing
Same story as the whole pack - it's not 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 use ComfyUI Manager (search "Data analysis"), which is the path most people take. Either way, restart ComfyUI afterward. No GPU, no model downloads, just pandas and friends.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| data | PYDICT | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| DATAFRAME | DATAFRAME | — |