Pandas Load CSV With Encoding
The CSV loader for files that aren't UTF-8
- DATAFRAME
The plain Pandas Load CSV node assumes your file is UTF-8. That's fine until it isn't - and it stops being fine the moment someone hands you a CSV with accented characters that was saved by an old Excel, a French Windows machine, or a 1990s ERP system. PandasLoadCSVWithEncoding is the loader that lets you say what encoding the file is actually in, so "café" doesn't come out as "café" and the whole file doesn't crash on a decoding error.
It's part of HowToSD's ComfyUI-Data-Analysis pack, Hide Inada's pandas/matplotlib/seaborn wrapper set for ComfyUI. No GPU, no models - the CSV loader family is where every real analysis starts.
How it works
Under the hood it's pd.read_csv(file_path, encoding=encoding). Everything else is identical to the base loader: IS_CHANGED returns NaN so the file is re-read every run, relative paths resolve against the ComfyUI installation directory, and the output is a standard DataFrame.
The encoding input is a plain string you fill with a Python codec name. The author's docs point you at Python's standard encodings list, and the user guide gives the concrete example you'll hit most: latin_1 for files with accented characters from the US and Western Europe. Others you'll run into: cp1252 (Windows Western), shift_jis or cp932 for Japanese, gbk for Chinese.
The inputs that matter
- file_path - the CSV location, relative to ComfyUI's folder or absolute.
- encoding - the codec name, like
utf-8,latin_1,cp1252,shift_jis. This is the whole point of the node; if you're unsure what a file uses, trylatin_1or open it in a real editor that detects encodings first.
Output is a single DATAFRAME.
Installing it
Standard pack install. ComfyUI Manager: search "ComfyUI-Data-Analysis", install, restart. Manager installs pandas, matplotlib, seaborn, scipy, scikit-learn, openpyxl, and lxml for you. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/HowToSD/ComfyUI-Data-Analysis.git
pip install -r requirements.txt
Rename the folder to data-analysis if you want the bundled example workflows to work. License: custom non-commercial - personal/academic use is fine, commercial use needs the author's written permission.
Gotchas
Wrong encodings fail in one of two ways: a hard UnicodeDecodeError that stops the run, or - sneakier - a file that loads but with mojibake: café, “ quotes, é turning into é. The second one is worse because nothing errors; the garbage just flows into your analysis. If you see replacement characters or odd Ã/â sequences, you've got an encoding mismatch - try latin_1 or cp1252 for Western data. And note the encoding you specify is also used on the way out if you save - mismatch there reproduces the same mojibake. When in doubt, UTF-8 stays the default for a reason; reach for this node only when the base loader fails or lies.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| file_path | STRING | — | |
| encoding | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| DATAFRAME | DATAFRAME | — |