100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace

SciPy Cheat Sheet

SciPy Cheat Sheet

SciPy scientific computing reference covering statistics, optimization, linear algebra, and interpolation for numerical Python workflows.

2 PagesIntermediateMar 28, 2026

scipy.stats

Distributions and hypothesis tests.

python
from scipy import statst_stat, p_value = stats.ttest_ind(group_a, group_b)   # two-sample t-testr, p = stats.pearsonr(x, y)                             # Pearson correlationdist = stats.norm(loc=0, scale=1)print(dist.pdf(0), dist.cdf(1.96))z_scores = stats.zscore(data)

scipy.optimize

Minimization and root finding.

python
from scipy import optimizedef f(x):    return (x[0] - 3) ** 2 + (x[1] + 1) ** 2result = optimize.minimize(f, x0=[0, 0], method="BFGS")print(result.x, result.fun)root = optimize.brentq(lambda x: x ** 2 - 4, 0, 5)     # find root in [0, 5]

Linear Algebra & Interpolation

Solve systems and interpolate data.

python
from scipy import linalg, interpolateA = [[2, 1], [1, 3]]b = [3, 5]x = linalg.solve(A, b)                 # solve Ax = beigvals, eigvecs = linalg.eig(A)f = interpolate.interp1d(x_known, y_known, kind="cubic")y_new = f(x_query)

Key Submodules

Major areas of SciPy's functionality.

  • scipy.stats- probability distributions and hypothesis tests
  • scipy.optimize- minimization, curve fitting, root finding
  • scipy.linalg- linear algebra beyond NumPy (LU, eig, solve)
  • scipy.sparse- sparse matrix formats and operations
  • scipy.signal- filtering, convolution, spectral analysis
  • scipy.spatial- distance metrics, KD-trees, Voronoi diagrams
  • scipy.integrate- numerical integration and ODE solvers
  • scipy.interpolate- 1D/2D interpolation of data points
Pro Tip

scipy.optimize.curve_fit is often simpler than minimize for fitting a parametric function to data — it wraps least-squares fitting and returns both the parameters and their covariance matrix for uncertainty estimates.

Was this cheat sheet helpful?

Explore Topics

#SciPy#SciPyCheatSheet#DataScience#Intermediate#ScipyStats#ScipyOptimize#LinearAlgebraInterpolation#KeySubmodules#MachineLearning#CheatSheet#SkillVeris
Advertisement
Sri Hayavadhana Info-Tech

Professional Web Designing Services

  • Responsive Websites
  • E-commerce Solutions
  • SEO Friendly Design
  • Fast & Secure
  • Support & Maintenance
Get a Free Quote

Related Glossary Terms

Share this Cheat Sheet