← Back to the calculator

Data and fitting

A calculation notebook is rarely about a single number: it is about a series of measurements. “Import data” turns them into variables of the document, usable like all the others.

Importing

The “Import data” button reads a CSV file, a TSV, a spreadsheet, or simply a table pasted from a spreadsheet application. The separator and the decimal separator are detected; the first line serves as a header if it looks like column names.

Each column becomes a variable. A t column and a y column give two lists, usable in any cell — including in an ordinary calculation. The file never leaves your machine: it is read by the browser, never uploaded.

Describing

“≡ Selection” ▸ Operation ▸ Data & statistics gives the usual descriptions (mean, median, standard deviation, quantiles), the histogram with a fitted distribution, statistical tests and interpolation.

Fitting a model

Data & statistics ▸ Fit a model asks for three things: the data, the model (written in plain form, for example A·exp(-k·t)), and starting values for the parameters. It returns:

If each point carries its own uncertainty, it is taken into account: better-measured points weigh more.

Try it: the “Exponential fit” and “Regression with uncertainties” templates

Exponential fit fits A·e^{-kt} to a decay and shows its residuals. Regression with uncertainties fits a line weighting each point by its uncertainty — compare the slope obtained with that of an unweighted regression to see what the weighting changes.

Where to go next

To fit a model that is itself the solution of a differential equation, see ODEs and optimisation. For a treatment no operation covers, the Python cell sees the same columns.