Python Charts
    • Matplotlib 63 The core library, with full control over every element
    • Plotly 27 Interactive charts for the web and notebooks
    • Seaborn 17 Statistical plots straight from DataFrames
    • Pandas 8 Quick charts with df.plot()
    • Altair 5 Declarative charts built on Vega-Lite
    • Plotnine 3 ggplot2's grammar of graphics in Python
    • Streamlit 1 Charts inside Streamlit data apps
    • A/B Testing 15 Sample size, analysis and sequential tests
    • Machine Learning 14 Evaluate and explain scikit-learn models
    • Causal Inference 10 Diff-in-diff, synthetic control, IV and more
    • AI 1 Use LLMs to build charts from your data
  • Python
  • All Posts
  • Ratio Metrics in A/B Tests: The Delta Method in Python
    A/B Testing

    Ratio Metrics in A/B Tests: The Delta Method in Python

    Analyze ratio metrics like click-through rate and revenue per session when you randomize by user. See why the naive test is too confident, compute a delta-method standard error in Python, and check it with a bootstrap and an A/A simulation.

    Nov 26, 2026
    ab testing experimentation ratio metrics delta method click-through rate bootstrap confidence interval pandas
  • CUPAC in Python: Use a Machine Learning Model to Reduce A/B Test Variance
    A/B Testing

    CUPAC in Python: Use a Machine Learning Model to Reduce A/B Test Variance

    Implement CUPAC in Python: train a gradient boosting model on a past cohort, use its prediction as the CUPED covariate, and see how much narrower the A/B test interval gets than with CUPED or linear regression.

    Nov 26, 2026
    ab testing experimentation cupac cuped variance reduction gradient boosting scikit-learn confidence interval
  • Switchback and Cluster-Randomized Experiments in Python
    A/B Testing

    Switchback and Cluster-Randomized Experiments in Python

    Analyze experiments where users can't be randomized one by one: cluster-randomized tests with cluster-robust standard errors, ICC and design effect, and switchback tests with block length and washout.

    Nov 25, 2026
    ab testing experimentation cluster randomization switchback interference intraclass correlation design effect statsmodels
  • Multiple Testing Corrections for A/B Tests in Python: Bonferroni, Holm and Benjamini-Hochberg
    A/B Testing

    Multiple Testing Corrections for A/B Tests in Python: Bonferroni, Holm and Benjamini-Hochberg

    Correct the p-values of an A/B test with many metrics using statsmodels multipletests, compare Bonferroni, Holm and Benjamini-Hochberg, and read the result on a forest plot.

    Nov 25, 2026
    ab testing experimentation multiple testing bonferroni benjamini-hochberg false discovery rate statsmodels forest plot
  • Sample Ratio Mismatch (SRM) Check in Python for A/B Tests
    A/B Testing

    Sample Ratio Mismatch (SRM) Check in Python for A/B Tests

    Check an A/B test for a sample ratio mismatch with scipy's chi-square test, find which segment causes it, and see how a lost-user bug can fake a lift.

    Nov 25, 2026
    ab testing experimentation sample ratio mismatch srm chi-square scipy data quality
  • A/B Testing in Python: A Guide from Sample Size to Sequential Tests
    A/B Testing

    A/B Testing in Python: A Guide from Sample Size to Sequential Tests

    A map of the A/B testing tutorials: plan the sample size, analyze the result, sharpen it with CUPED, check it with a bootstrap, try the Bayesian view and avoid the damage from peeking.

    Nov 25, 2026
    ab testing experimentation statistics sample size cuped bayesian sequential testing guide
  • CUPED in Python: Reduce A/B Test Variance with a Pre-Experiment Covariate
    A/B Testing

    CUPED in Python: Reduce A/B Test Variance with a Pre-Experiment Covariate

    Implement CUPED in Python: adjust an A/B test metric with pre-experiment data to shrink confidence intervals, check it against OLS, and see how much variance you can remove.

    Nov 25, 2026
    ab testing experimentation cuped variance reduction statsmodels confidence interval regression adjustment
  • Multi-Armed Bandit in Python: Thompson Sampling vs A/B Testing
    A/B Testing

    Multi-Armed Bandit in Python: Thompson Sampling vs A/B Testing

    Implement Thompson sampling for a multi-armed bandit in Python with NumPy, compare it with a fixed A/B/n split and epsilon-greedy using regret curves, and learn what a bandit costs you in measurement.

    Nov 25, 2026
    ab testing experimentation multi-armed bandit thompson sampling regret epsilon-greedy bayesian numpy
  • Peeking at A/B Tests: Simulate the Damage and Fix It with Sequential Testing
    A/B Testing

    Peeking at A/B Tests: Simulate the Damage and Fix It with Sequential Testing

    Simulate A/A tests to see how checking an A/B test early inflates false positives from 5% to about 25%, then fix it with group sequential boundaries or an always-valid mSPRT p-value.

    Nov 25, 2026
    ab testing experimentation peeking sequential testing msprt group sequential false positive rate simulation
  • A/B Test Analysis in Python: Conversion Rate and Revenue
    A/B Testing

    A/B Test Analysis in Python: Conversion Rate and Revenue

    Analyze an A/B test in Python: a two-proportion z-test for conversion rate, a Welch t-test for revenue per user, confidence intervals, and a chart of the lift.

    Nov 25, 2026
    ab testing experimentation statsmodels scipy confidence interval hypothesis testing conversion rate
  • Bayesian A/B Testing in Python: Beta-Binomial Posteriors and P(B > A)
    A/B Testing

    Bayesian A/B Testing in Python: Beta-Binomial Posteriors and P(B > A)

    Run a Bayesian A/B test on conversion rates in Python with SciPy. Build Beta posteriors, compute the probability that B beats A, a credible interval for the lift, and the expected loss of each decision.

    Nov 25, 2026
    ab testing experimentation bayesian beta-binomial credible interval scipy conversion rate expected loss
  • Novelty and Primacy Effects in A/B Tests: Detect Them in Python
    A/B Testing

    Novelty and Primacy Effects in A/B Tests: Detect Them in Python

    Check whether an A/B test's lift is fading, fit an exponential decay to separate the novelty bump from the lasting effect, and compare new and returning users.

    Nov 25, 2026
    ab testing experimentation novelty effect primacy effect lift over time curve fit scipy pandas
  • A/B Test Segment Analysis in Python: Heterogeneous Effects Without Fooling Yourself
    A/B Testing

    A/B Test Segment Analysis in Python: Heterogeneous Effects Without Fooling Yourself

    Break an A/B test down by segment in Python, test whether the lift really differs across segments with an interaction test, and avoid the winner's curse with Holm correction and shrinkage.

    Nov 25, 2026
    ab testing experimentation heterogeneous treatment effects subgroup analysis interaction test winners curse shrinkage statsmodels
  • A/B Test Sample Size and Power Analysis in Python
    A/B Testing

    A/B Test Sample Size and Power Analysis in Python

    Work out how many users an A/B test needs in Python with statsmodels, plot power curves, and see how baseline rate and minimum detectable effect drive the answer.

    Nov 25, 2026
    ab testing experimentation statsmodels power analysis sample size minimum detectable effect conversion rate
  • Bootstrap Confidence Intervals in Python for A/B Tests
    A/B Testing

    Bootstrap Confidence Intervals in Python for A/B Tests

    Compute and plot a bootstrap confidence interval for an A/B test in Python with scipy.stats.bootstrap, compare percentile and BCa intervals, and bootstrap a median.

    Nov 25, 2026
    ab testing experimentation bootstrap confidence interval scipy revenue resampling

Python plotting and visualization demystified

© 2026 PythonCharts.com. All rights reserved.
  • About
  • Credits
  • Privacy Policy