Use scipy.stats.skew to calculate sample skewness for an array, either along an axis or across its flattened values. By default, it returns the biased Fisher–Pearson coefficient; set bias=False for the adjusted coefficient. Choose the axis and NaN policy explicitly when your data contains multiple dimensions or missing values.
What `scipy.stats.skew` calculates
The function computes sample skewness, a measure of asymmetry based on the third central moment. SciPy defines its default result as the Fisher–Pearson coefficient:
As an Amazon Associate I earn from qualifying purchases.
g₁ = m₃ / m₂3/2
Here, mᵢ = (1/N) Σ(x[n] − x̄)ⁱ, where x̄ is the sample mean and N is the number of values in the slice. The central moments use N as their denominator. See the SciPy 1.18.0 skew reference.
Basic Python example
Import the function from scipy.stats, then pass it a list or array:
#1 Best Overall
from scipy.stats import skew
values = [1, 2, 3, 4, 5]
print(skew(values)) # 0.0
This is one of the examples in SciPy’s documentation. Another documented example is:
skew([2, 8, 0, 4, 1, 9, 9, 0])
# 0.2650554122698573
Choose the estimator with `bias`
bias=True is the default and returns the moment coefficient g₁. For the adjusted Fisher–Pearson standardized moment coefficient, use bias=False:
Rank #2
G₁ = √(N(N−1))/(N−2) × m₃/m₂3/2
| Setting | Result |
|---|---|
bias=True |
Biased sample-moment coefficient g₁; default. |
bias=False |
Adjusted coefficient G₁. |
Calculate skewness across array dimensions
By default, axis=0, so SciPy calculates skewness along the first axis. Set another axis to work along that dimension, or use axis=None to flatten the input and calculate one result across all values. Set keepdims=True to preserve the reduced axes as dimensions of length one, which can help when broadcasting the result with the original array.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →from scipy.stats import skew
# One result per column for a two-dimensional array:
column_skew = skew(data, axis=0)
# One result across every value:
all_skew = skew(data, axis=None)
# Keep the reduced axis for broadcasting:
column_skew_for_broadcasting = skew(data, axis=0, keepdims=True)
Handle missing values with `nan_policy`
| Policy | Behavior |
|---|---|
'propagate' |
Default: a NaN in an axis slice makes that slice’s result NaN. |
'omit' |
Ignore NaNs in the slice; the result is NaN if too few usable values remain. |
'raise' |
Raise ValueError when NaNs are present. |
For example, if missing values should be excluded rather than propagated, call skew(data, nan_policy='omit'). The choice applies to each calculation slice along the selected axis.
Interpret the result—and its limits
For a unimodal continuous distribution, a positive skewness value indicates greater weight in the right tail; a negative value indicates greater weight in the left tail. A normally distributed sample should have skewness about zero, but a value near zero is descriptive evidence, not a statistical test of normality. SciPy points to skewtest for assessing statistically whether skewness is sufficiently close to zero. The SciPy skew documentation also notes this distinction.
Skewness is not defined when all values in a slice are equal; the current SciPy reference says such input returns NaN. For broader distribution checks, SciPy’s statistical-functions index lists skewtest, normaltest, and jarque_bera alongside descriptive statistics such as skew (SciPy 1.18.0 statistical functions).
Complete call pattern
skew(a, axis=0, bias=True, nan_policy='propagate', *, keepdims=False)
These options control the calculation and output shape; they do not change the input data in place. SciPy’s describe function also reports skewness and supports bias correction in its calculations (SciPy 1.18.0 describe reference).
Recommended Free Tools
Array API backend support in SciPy 1.18.0
The SciPy 1.18.0 reference labels Array API support for skew experimental. Its listed combinations are:
Best Value
| Backend | Listed device support |
|---|---|
| NumPy | CPU |
| CuPy | GPU |
| PyTorch | CPU and GPU |
| JAX | CPU and GPU |
| Dask | CPU |
Because the documentation labels this support experimental, check the version-specific reference before relying on a backend or device combination in an application.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




