Numpy Float Create
Type a list, get a float32 array
- NDARRAY
Numpy Float Create is the pack's on-canvas way to build a Numpy array: you type a Python list into a multiline text field, and out comes a proper float32 ndarray on an NDARRAY socket. It's the entry point for any workflow that starts with raw numbers rather than a CSV - sample data, test arrays, hand-built vectors for a computation you want to eyeball.
It's part of HowToSD's ComfyUI-Data-Analysis pack, and it's the float half of the Numpy creation pair (the sibling, Numpy Int Create, produces int32). The pack wraps Pandas, NumPy, Matplotlib, and Seaborn for the node graph, and this is where NumPy data enters the graph when you don't have a file to load.
How it works
Two steps under the hood. First, ast.literal_eval(data) parses your text - and here's the key constraint: it expects valid Python literal syntax, not JSON. So [1.5, 2.5, 3.0] works, and so does a nested list like [[1, 2], [3, 4]] for a 2D array. Then np.array(list_data, dtype=np.float32) builds the array with explicit 32-bit float precision.
That dtype choice is worth internalizing: your array is float32, which matches what many ML pipelines expect but means values get rounded to float32 precision. If you need float64, this node isn't the way - the cast is fixed.
Inputs and outputs
- data (required,
STRING, multiline) - a Python literal:[1.5, 2.5, 3.0]or a nested list for 2D. - NDARRAY output - the float32 array.
When you'd use it
The classic flow is building a small test array and inspecting it: Numpy Float Create → Numpy Show to see what you made, or → Numpy Squeeze to reshape before use. It also feeds Pandas Create From Numpy when you want to turn raw numbers into a DataFrame without a CSV - type your data, convert to an array, then into a frame. For real data files, though, Pandas Load CSV is the better entry; this node shines for samples and quick experiments.
Installing it
Pack install, once. ComfyUI Manager: search "Data analysis", install ComfyUI-Data-Analysis, restart, reload the browser tab. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/HowToSD/ComfyUI-Data-Analysis
mv ComfyUI-Data-Analysis data-analysis # README: examples depend on this folder name
pip install -r data-analysis/requirements.txt
Dependencies: pandas, matplotlib, seaborn, scipy, scikit-learn, openpyxl, lxml. No GPU, no model files. Since March 2025 the PyTorch-tensor nodes live in the separate ComfyUI-Pt-Wrapper extension.
Gotchas
- Python literal, not JSON. Single quotes are fine (
['a']would work syntactically), but[1,2,]trailing commas are not, and bare words error atliteral_eval. Keep it to numbers and nested lists. - float32, always. Precision is capped at 32-bit; a number like
0.1is stored as the float32 approximation. - Malformed text fails at this node with a clear error - that's a feature; it beats failing invisibly downstream.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| data | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| NDARRAY | NDARRAY | — |