histogramHistogram
Group your measurements in a histogram. See the mean and standard deviation to understand where your data clusters and how much it spreads.
histogram(measurements)
Explore histogram
MesPy is a collection of Python functions for the physics lab. It shows the distribution of your measurements with their mean and standard deviation, fits a line to your data weighting each point by its uncertainty, and returns the slope and intercept with their uncertainties, along with the residuals.
Edit the example data and press Run: the real lin_fit computes the plot and the TOML in your browser.
Edit the measurements and press Run.
The first run downloads Python and the scientific packages. Analysis runs in your browser.
histogramGroup your measurements in a histogram. See the mean and standard deviation to understand where your data clusters and how much it spreads.
histogram(measurements)
Explore histogram
lin_fitFind the line that describes your measurements. Get the slope, intercept and their uncertainties, with a residual plot to explore the result.
lin_fit(x, y, sigma_y)
Explore lin_fit
Both draw with Matplotlib and return objects you can reuse: the figure and axes for the histogram, a result with parameters, uncertainties and residuals for the fit.
Each function has a page with its signature, parameters and input checks. For lin_fit you will find the OLS and WLS cases, the propagation of x uncertainties and the χ² diagnostics; for histogram, how the bins are built and the normalizations.
Open the API ReferenceMesPy requires Python 3.12 or later. The guide covers installation on Google Colab and on your computer, then the first import.
Installation guide