ComfyUI Node

Pandas Skew

Is your data lopsided? One node for skewness

By HowToSD·Created 2 years ago·Updated about a year ago· 23
Pandas Skew
  • dataframe
  • PDSERIES
axis

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 column
  • columnsskew(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. Default index is 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: index means "compute down the rows, one result per column." Don't overthink it - leave it on index.
  • 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.
CategoryData Analysis

Inputs (2)

NameTypeDefaultDescription
dataframeDATAFRAME
axisCOMBO2 options: index, columns

Outputs (1)

NameTypeDescription
PDSERIESPDSERIES