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
  • 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
  • Event Study Plot in Python for Staggered Difference-in-Differences
    Causal Inference

    Event Study Plot in Python for Staggered Difference-in-Differences

    Build an event-study plot for a staggered rollout in Python, see why a two-way fixed effects regression gives distorted leads and lags, and fix it with clean never-treated comparisons.

    Nov 25, 2026
    causal inference difference in differences event study staggered adoption two-way fixed effects parallel trends 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
  • Difference-in-Differences in Python: Parallel Trends Plot and Regression
    Causal Inference

    Difference-in-Differences in Python: Parallel Trends Plot and Regression

    Estimate a treatment effect with difference-in-differences in Python: plot parallel trends, run the regression in statsmodels, and draw an event-study chart.

    Nov 25, 2026
    difference-in-differences causal inference parallel trends event study statsmodels regression
  • 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
  • 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
  • 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
  • CausalImpact in Python: Estimate a Campaign's Effect with Structural Time Series
    Causal Inference

    CausalImpact in Python: Estimate a Campaign's Effect with Structural Time Series

    Estimate the effect of a campaign with no randomized control using a CausalImpact-style model in Python: a structural time series fit on the pre-period with control series, then forecast forward as the counterfactual.

    Nov 25, 2026
    causal inference causalimpact structural time series counterfactual campaign measurement placebo test statsmodels time series
  • 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
  • Propensity Score Matching and IPW in Python (with a Love Plot)
    Causal Inference

    Propensity Score Matching and IPW in Python (with a Love Plot)

    Estimate a treatment effect from observational data in Python with propensity scores: fit them with scikit-learn, reweight with IPW, match on them, and check covariate balance with a love plot.

    Nov 25, 2026
    causal inference propensity score matching ipw observational data covariate balance scikit-learn statsmodels
  • Regression Discontinuity in Python: RD Plot and Local Linear Estimate
    Causal Inference

    Regression Discontinuity in Python: RD Plot and Local Linear Estimate

    Estimate a treatment effect at a cutoff in Python with regression discontinuity: draw the RD plot, fit a local linear model with statsmodels, and check bandwidth sensitivity, density, and placebo cutoffs.

    Nov 25, 2026
    causal inference regression discontinuity rdd statsmodels observational data bandwidth matplotlib
  • Interrupted Time Series in Python: Why Before/After Comparisons Mislead
    Causal Inference

    Interrupted Time Series in Python: Why Before/After Comparisons Mislead

    Measure the effect of a launch or policy change with no control group: see why a before/after comparison overstates it, then fit an interrupted time series in Python with statsmodels.

    Nov 25, 2026
    causal inference interrupted time series pre-post analysis segmented regression statsmodels time series counterfactual

Python plotting and visualization demystified

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