Pages

Topics

Tools

↑↓navigate↵openescclose

Python guides

Every published Python guide, newest first, with practical examples you can copy into your own project.

3,965 guides across 14 topics

Topics

Latest Python guides

A side-by-side comparison of NumPy and SciPy logos with a focus on array operations versus advanced scientific algorithms.
Python

Python SciPy vs NumPy: When to Use Which

Understand the relationship between NumPy and SciPy, what each library provides, and when to use which for numerical computing in Python.

NumPySciPyPythonScientific Computing
A visual metaphor for sparse matrices showing a grid with only a few highlighted cells, representing nonzero entries, and a linear algebra solver icon.
Python

Python SciPy Sparse Matrices and Linear Algebra

Learn how SciPy sparse matrices store only nonzero values, choose among CSR, CSC, COO, LIL, and DIA formats, and solve sparse linear systems and eigenvalue problems.

scipysparse matriceslinear algebraspsolve
Illustration of a time-domain waveform transforming into a frequency spectrum using SciPy FFT
Python

Python SciPy Signal Processing and FFT: Core Workflows

Use SciPy's FFT functions in Python to compute spectra, filter signals in the frequency domain, and reconstruct real-valued signals.

scipyfftsignal processingnumpy
Illustration of a curve being integrated and interpolated with SciPy, showing a smooth line and area under the curve.
Python

SciPy Integration, Interpolation, and ODE Solving in Python

Practical Python examples for SciPy numerical integration, interpolation, and ODE solving.

scipynumerical methodsintegrationinterpolation
An illustration of a data scatter plot with a fitted curve, representing scipy optimize minimize and curve fitting in Python.
Python

How to Use scipy.optimize.minimize and curve_fit in Python

Learn how to use scipy.optimize.minimize for general optimization and curve_fit for nonlinear least squares fitting, including bounds, constraints, and common pitfalls.

scipyoptimizationcurve-fittingminimize
Illustration of statistical tests in Python using SciPy, showing t-test, chi-square, and correlation concepts.
Python

Python SciPy t-test, Chi-square, and Correlation

Learn how to perform t-tests, chi-square tests, and correlation analysis with scipy.stats, including code examples, assumptions, and practical guidance.

scipystatisticshypothesis testingt-test
Chart showing a fitted normal distribution curve overlaid on a histogram of sample data with a p-value annotation.
Python

Python SciPy Statistics: Distributions and Hypothesis Testing

python scipy statistics distributions and hypothesis testing: Practical guide to using scipy.stats for probability distributions, distribution fitting, and hypothesis...

scipystatisticshypothesis testingprobability distributions
Illustration comparing Polars and pandas DataFrame processing, showing a columnar Arrow engine versus a single-threaded NumPy-based pipeline.
Python

Python Polars vs Pandas Performance: What Actually Matters

Polars and pandas differ in execution, memory, and API design. Learn which DataFrame library fits your workload.

PolarspandasDataFramesperformance
Illustration of two data table icons with a bidirectional arrow between them, representing data conversion between Polars and pandas.
Python

Converting Between pandas and Polars in Python: Syntax and Pitfalls

Learn how to convert DataFrames between Polars and pandas in Python, including dtype mapping, index behavior, null handling, and performance tradeoffs.

PolarspandasData ConversionDataFrames
Illustration of Polars streaming engine processing a large dataset in batches, with memory usage staying flat while data flows through a pipeline.
Python

Python Polars Streaming and Large Dataset Processing

python polars streaming and large dataset processing: Learn how Polars' streaming engine processes datasets larger than available memory by working in batches, which o...

polarsstreaminglarge-datalazy-api