Pandas Skew
Is your data lopsided? One node for skewness
- dataframe
- PDSERIES
Skewness is the stat that answers "is my data sitting to one side of the mean?" - and Pandas Skew computes it per column with a single dropdown to control the direction. It's one of the pack's summary-statistics nodes, in the same family as Pandas Std and Pandas Var, and like them it collapses a DataFrame down into a Series.
When do you care? Any time you're about to feed a distribution into something that assumes it's roughly normal. A heavily skewed column (say, salary data where a few big earners drag the tail right) will misbehave in simple normalization and can mislead a scatter plot. In the ComfyUI-Data-Analysis world you'd run this, read the numbers in Pandas Show Series, and decide whether a log or Box-Cox-style transform (or a Pandas Sin on periodic data) is warranted before plotting with the pack's Matplotlib/Seaborn nodes.
How it works
It's a thin wrapper over pandas' own DataFrame.skew(), which computes the unbiased skewness (that's the standard g1 estimator - the docs say so). The axis dropdown maps to pandas' axis argument:
index(the default) →skew(axis=0)→ one skew value per columncolumns→skew(axis=1)→ one skew value per row
The result is a PDSERIES. Like std() and var(), the calculation skips NaN cells rather than exploding on them.
Inputs and outputs
dataframe(DATAFRAME) - the frame to measure. Non-numeric columns come back as NaN, since skewness is a numeric concept.axis(enum:index/columns) - direction. Defaultindexis almost always what you want.
Output: a single PDSERIES of skewness values. Wire it into Pandas Show Series to read it, Pandas Series To Dataframe if you want it back in table form, or keep it in a pipeline feeding a downstream comparison.
Installing this pack
This node ships in ComfyUI-Data-Analysis by Hide Inada (HowToSD). CPU-only, no GPU, no model downloads - but the pack does need its Python stack, which a stock ComfyUI won't have: 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 handles the dependencies.
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
- The axis dropdown confused me. It's inherited from pandas:
indexmeans "compute down the rows, one result per column." Don't overthink it - leave it onindex. - Column came back NaN. That column isn't numeric. Convert or drop it upstream.
- Where's my output? The output is a Series, not a DataFrame - if your next node wants a DATAFRAME, insert a Series-to-DataFrame node between them.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| dataframe | DATAFRAME | — | |
| axis | COMBO | 2 options: index, columns |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| PDSERIES | PDSERIES | — |