Skip to content
Learn Netverks

Lesson

Step 9/36 25% through track

descriptive-scipy-stats

Descriptive stats with SciPy

Last reviewed Jun 1, 2026 Content v20260601
Track mode
server_script
Means
Server runner
Reading
~1 min
Level
beginner

This lesson

This lesson teaches Descriptive stats with SciPy: SciPy scientific routines on NumPy arrays—statistics, optimization, linear algebra, and numerical methods.

p-values without assumptions mislead stakeholders—know your test and sample design first.

You will apply Descriptive stats with SciPy in contexts like: A/B tests, experiment analysis, and quality-control sampling.

Read the narrative, run NumPy + SciPy snippets in the playground (install scipy and numpy with pip if needed), inspect outputs and convergence, and complete MCQs.

When you can explain the previous lesson's ideas in your own words.

Beyond np.mean, stats.describe returns count, mean, variance, skewness, and kurtosis in one call—useful for quick EDA on ndarray exports from Pandas.

Key functions

  • stats.describe — nobs, minmax, mean, variance, skewness, kurtosis
  • stats.tstd, stats.tvar — sample std/var (ddof=1 default)
  • stats.sem — standard error of the mean
  • stats.iqr — robust spread measure
  • stats.zscore — standardize for comparison

describe vs describe

Pandas df.describe() is tabular and column-wise. stats.describe targets one numeric array—ideal after series.to_numpy().

Example

import numpy as np
from scipy import stats

x = np.array([10, 12, 11, 15, 9, 14, 13])
d = stats.describe(x)
print('nobs:', d.nobs, 'mean:', d.mean, 'var:', d.variance)

Important interview questions and answers

  1. Q: skewness meaning?
    A: Asymmetry: positive skew = long right tail; affects choice of mean vs median.
  2. Q: zscore use?
    A: Compare values on different scales; watch outliers—zscore is sensitive.

Self-check

  1. What five quantities does stats.describe return?
  2. When prefer median and IQR over mean and std?

Tip: Pair stats.describe with a histogram mentally—skewness without a plot misleads.

Interview prep

describe?

nobs, minmax, mean, variance, skewness, kurtosis in one call.

zscore?

Standardize for comparison—sensitive to outliers.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs on the configured server runner (dev: npm run runner with LEARNING_RUNNER_ENABLED=true). Output appears below the editor.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • describe()?
  • Trimmed mean?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump