mespy
mespy is a Python toolbox for experimental data analysis.
This documentation is organized by module: each main file has an overview page and a separate page for each public function. In parallel there is a section dedicated to internal checks, useful for understanding how the package normalizes inputs and handles errors.
What you’ll find here
Installation to prepare the local environment and verify the import.
Quick start to begin with the most common workflow.
Examples for ready-to-adapt usage notebooks.
io_utils for CSV loading.
stats_utils for descriptive and weighted statistics.
plot_utils for visualization.
fit_utils for weighted linear fitting.
Internal checks and helpers for validators and private helpers.
Package goals
offer small, readable APIs
validate problematic inputs early
produce clear errors in notebooks and teaching scripts
keep the public API separate from internal details
Quick example
from mespy import histogram, load_csv, weighted_mean
df = load_csv(
"data/reference/test_misure.csv",
required_columns=["lunghezza_mm", "sigma_mm"],
)
media = weighted_mean(df["lunghezza_mm"], 1 / df["sigma_mm"]**2)
fig, ax = histogram(
df["lunghezza_mm"],
xlabel="lunghezza [mm]",
title=f"Media = {media:.3f} mm",
)