Pandas Feature Split To Pt
Ship your table straight to PyTorch tensors
- dataframe
- feature
- label
This is the PyTorch version of Pandas Feature Split To Numpy: same split into feature and label, but the outputs are torch TENSORs instead of NumPy arrays, and you get to pick the dtype for each. If your downstream is a neural network - a small tabular model, an embedding pipeline, anything that eats tensors - this node is the bridge that gets your pandas table off the ComfyUI canvas and into tensor land without hand-rolling conversions.
There's a pack-level context you should know before you rely on it. The README's March 2025 update notes that the PyTorch nodes were split into a companion extension, ComfyUI-Pt-Wrapper, and the author's guidance is to install that too if you're doing PyTorch work. This node still ships in this pack and produces TENSOR outputs, but the friendly nodes that consume those tensors - plotting them, converting them to images - live in Pt-Wrapper. Install both, or you'll have a tensor output with nowhere friendly to plug it in.
How it works
Same splitting logic as the NumPy twin: label_integer_position picks the label column (default -1 = last), everything else becomes features, and output_1d_label (default on) flattens the label. Then the arrays get wrapped with torch.tensor(...) and cast to whatever dtype you chose in the two dropdowns.
Those dropdowns are where the fun lives. feature_data_type and label_data_type each offer float32, float16, float64, int8, uint8, int16, int32, int64 - and bloat16. That last one is a typo in the pack for bfloat16, and it's a real trap: the code does getattr(torch, "bloat16"), no such attribute exists on torch, so picking it raises an AttributeError and the node errors out. Use float16 instead - it's the closest real option. Default float32 is the right call for features feeding a model, and int64 is typical for classification labels.
Inputs and outputs
- dataframe (required,
DATAFRAME) - the frame to split. - label_integer_position (required,
INT, default-1) - the label column position. - output_1d_label (required,
BOOLEAN, default on) - 1D vs 2D label. - feature_data_type / label_data_type (required, enums) - torch dtypes for each output. Skip
bloat16. - feature (
TENSOR) and label (TENSOR) outputs.
Installing it
Install this pack plus the Pt-Wrapper companion:
cd ComfyUI/custom_nodes
git clone https://github.com/HowToSD/ComfyUI-Data-Analysis
git clone https://github.com/HowToSD/ComfyUI-Pt-Wrapper
mv ComfyUI-Data-Analysis data-analysis
pip install -r data-analysis/requirements.txt
Or search "Data analysis" in ComfyUI Manager and install ComfyUI-Data-Analysis there, then grab Pt-Wrapper the same way. The requirements are pandas, matplotlib, seaborn, scipy, scikit-learn, openpyxl, lxml - torch itself comes with ComfyUI, so no extra model or GPU downloads are involved; this is a data-shape node, not a weights thing.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| dataframe | DATAFRAME | — | |
| label_integer_position | INT | -1-10–1024 | — |
| output_1d_label | BOOLEAN | true | — |
| feature_data_type | COMBO | 9 options: float32, float16, bloat16, float64, int8, uint8, +3 | |
| label_data_type | COMBO | 9 options: float32, float16, bloat16, float64, int8, uint8, +3 |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| feature | TENSOR | — |
| label | TENSOR | — |