
Python companion to ModernDive: a tidy simulation-inference grammar (infer), regression helpers, datasets, and dual-engine plotly/plotnine plots
Repo moderndive/moderndive-python, read from GitHub 1 d ago. moderndive has not joined Take My Repo.
Continues the R data-parity line: the datasets the R edition's end-of-chapter
exercises take from companion packages, so the Python exercises (all 11 chapters)
match the R book one-for-one.
load_planets() — confirmed exoplanets: mass, radius, orbit, discoveryexoplanetdata R package's planets). Used by theload_volcanoes() — Holocene volcanoes of the world (1,215 × 19;volcanoes::volcanoes). Used by the Chapter 7–11 exercises.load_eruptions() — documented volcanic eruptions with VEI and datesvolcanoes::eruptions).load_bob_ross() — element tags for every Joy of Painting episodefivethirtyeight::bob_ross). Used by the Chapter 4, 9, and 11tools/parity_manifest.jsonexoplanetdata 0.1.0, volcanoes 0.1.1, fivethirtyeight 0.6.2).generate(type="draw") with a non-string success level (e.g. a booleansuccess=True) produced an all-zero null distribution: thenp.where, which unified the successTrue into "True") before📦 Now on PyPI: pip install moderndive — https://pypi.org/project/moderndive/0.1.0/
Initial release of the Python companion to ModernDive: Statistical Inference
via Data Science — a faithful port of the R moderndive and infer packages,
targeting full functional, dataset, and argument-level parity on a modern Python
stack (polars, plotly, plotnine, statsmodels).
specify → hypothesize → generate → calculate, plus fit()observe(), and assume()t/z/F/Chisq). specify() is also a DataFrame method, sodf.specify(...) mirrors R's df %>% specify(...).calculate(stat=) vocabulary: mean, median, sum, sd, prop,count, diff in means/medians/props, ratio of means/props,odds ratio, slope, correlation, t, z, F, Chisq, plus anyhypothesize() point nulls for the mean (mu), median (med), proportionp), and one-sample mean z (sigma); a {level: probability} mappinggenerate() bootstrap / permute / draw (with "simulate" as an alias for"draw"), and variables= to choose the permuted column.percentile, se, bias-corrected) and simulationget_confidence_interval / get_p_value. British-spelling andt_test, prop_test, chisq_test, t_stat, chisq_stat, plus themoderndive.theory module. prop_test mirrors R's prop.test (chi-square byz=, conf_int=/conf_level=, and achisq_test(response=, p=) runsget_regression_table (conf_level, exponentiate,default_categorical_levels), get_regression_points (newdata=, ID=,get_regression_summaries,get_correlation (method=pearson/spearman/kendall, multiple predictors,wide=, na_rm=), pop_sd, tidy_summary, and count_missing.engine="plotly" (default, interactive) orengine="plotnine": visualize / shade_p_value / shade_confidence_intervalfill=, dens_color=, method="both"/"theoretical", and per-facetvisualize_fit), pairplot, gg_parallel_slopes /geom_parallel_slopes (alpha=), gg_categorical_model /geom_categorical_model, and plot_3d_regression. visualize() returns anInferPlot that composes with shading via + and renders in Jupyter/QuartoView() renders an interactive table via the optionalitables package. Static image export uses the optional moderndive[image]load_*() loaders returning polars DataFrames — the Rmoderndive/infer, nycflights23, gapminder, ISLR2, and FiveThirtyEightinfer-style messages and errors (a summary line + →ModernDiveMessage notes).