Nodes/ComfyUI-Data-Analysis/Pandas To String
ComfyUI Node

Pandas To String

A whole DataFrame, as one big text blob

By HowToSD·Created 2 years ago·Updated about a year ago· 23
Pandas To String
  • dataframe
  • STRING

Pandas To String converts an entire DataFrame into its string representation - the same grid of text pandas prints in a notebook. It's a display helper, and it's the node that makes the pack's tables actually readable on the canvas.

Here's the important wiring detail that trips people up: this node is not an output node. It takes a DATAFRAME in and returns a STRING out, but it won't show you anything by itself. You need to connect that string to a display node - normally Pandas Show Text, which is exactly what the pack's user guide does. The pairing is Pandas Load CSV → ... → Pandas To StringPandas Show Text, and that's how you read a whole table without squinting at a tiny preview. It's the DataFrame equivalent of what Pandas Show Series does for Series, just routed through a plain string instead of a JSON serialization.

How it works

It's str(dataframe) under the hood - the Python string form of the DataFrame, which is the standard tabular repr: header row, index column, one line per row, NaN shown as NaN. Nothing fancy, nothing lossy in the other direction. Once it's a string you can pass it to any text node in the graph, save it, or show it.

Inputs and outputs

  • dataframe (DATAFRAME) - the frame to render as text.

Output: a single STRING - the formatted table. Feed it into Pandas Show Text to display, or into any other string consumer.

Installing this pack

This node ships in ComfyUI-Data-Analysis by Hide Inada (HowToSD). CPU-only, no GPU, no model downloads - but the pack needs its Python stack, which stock ComfyUI lacks: pandas, matplotlib, seaborn, scipy, scikit-learn, openpyxl, lxml.

ComfyUI Manager: Manager → Custom Node Manager → search "Data analysis" → install ComfyUI-Data-Analysis → restart ComfyUI and refresh the browser. Manager installs the deps.

Git clone:

cd ComfyUI/custom_nodes
git clone https://github.com/HowToSD/ComfyUI-Data-Analysis.git
mv ComfyUI-Data-Analysis data-analysis   # example workflows depend on this folder name
pip install -r data-analysis/requirements.txt

Restart ComfyUI after installing.

Troubleshooting

  • I see nothing on this node. Right - it's not an output node. Add a Pandas Show Text node and wire the string output into it. This is the single most common confusion with this node.
  • Big frame, huge text blob. The string is one giant block. Resize the Pandas Show Text widget, or use Pandas Head upstream to trim the frame before converting.
  • Table looks squished. pandas truncates wide frames in the repr - very wide DataFrames print with ellipsis in the middle. If you need every column visible, consider Pandas Transpose or narrowing the frame first.
CategoryData Analysis

Inputs (1)

NameTypeDefaultDescription
dataframeDATAFRAME

Outputs (1)

NameTypeDescription
STRINGSTRING