Pandas Count
Non-null counts per column, in one Series — the data-quality check
- dataframe
- PDSERIES
Before you trust a table, you want to know how much of it is actually filled in. Pandas Count answers that: it counts the non-null values in every column and returns the results as a Series. It's the fastest data-quality check in the pack - wire it in, and in one glance you know which columns are complete and which are half-empty.
How it works
It calls pandas' dataframe.count(), which counts non-missing values (anything that isn't NaN or None) for each column. The subtlety people miss: this is not the number of rows. A column with three missing values in a 100-row table reports 97, and a completely empty column reports 0. So it's a per-column fill gauge, not a row counter.
The output is a Series indexed by column name - one entry per column with the count of populated cells.
Inputs and outputs
dataframe- the frame to inspect (DATAFRAME)- Output: a
PDSERIESwith the non-null count for each column
How you'd actually use it
Two classic spots. First, quality control: load a CSV and run Pandas Count into Pandas Show Series to eyeball which columns have gaps before you do anything clever. Second, as a check after a transform: run it after Pandas As Float or Pandas Cos and you'll instantly see how many cells survived the conversion as numbers versus turning into NaN - a missing-looking result tells you immediately your source wasn't numeric.
Because it outputs a Series, it also composes: you can take that count Series and add it to a DataFrame, convert it with Pandas Series To DataFrame, or inspect specific columns. The pack treats Series as first-class citizens, and this node is one of the best reasons that matters.
Installing it
Part of ComfyUI-Data-Analysis (author Hide Inada / HowToSD.com). Manager: search Data Analysis → install → restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/HowToSD/ComfyUI-Data-Analysis.git
mv ComfyUI-Data-Analysis data-analysis
pip install -r data-analysis/requirements.txt
No GPU needed; pandas comes via requirements.txt (Manager installs it automatically).
Gotchas
The count-vs-rows confusion is the one that bites. If you want the total row count, that's not this node - count each column separately and you'll get the same number only when there are no missing values. Also note count ignores NaN and None but does count empty strings (""), so a column of blank-looking text will still count as fully populated. If that matters, stringify and eyeball, or handle empties before counting.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| dataframe | DATAFRAME | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| PDSERIES | PDSERIES | — |