How-to guides
Import measurements from a CSV
Updated 3 November 2026 · 2 min read
Measurements go into a model as a data series: a column of values over time, compared with one stock or variable and drawn as dots against it. This is how to bring one in from a CSV.
Prepare the file#
The file needs two columns, time and value, one row per time unit of the model:
day,ill
0,10
1,12
2,18
3,23
- Commas, semicolons or tabs between the columns all work, so you can export from any spreadsheet.
- A header row is skipped. So is any row whose first two cells aren’t numbers.
- The times must go up by exactly one time unit a row, with no gaps. Weekly data wants a model that runs in weeks.
- Between 3 and 2,000 rows.
Import it#
- In the side panel, open Fit to Data.
- Under Add measurements from a CSV, set Compare with to the stock or variable your measurements are of. The list starts at the first stock, which is often not the one you want.
- Press Choose file and pick the CSV.
- 1The series, with its source, its time span and what it is compared with.
- 2Compare with.
- 3Choose file.
The panel says what it read, for example Added 46 points from outbreak-cases.csv, 0 to 45. The series is named after the file, and the first chart that draws the variable it is compared with now shows the measurements as dots.
What happens to it#
Each series keeps:
- What it is compared with. Fit to Data matches the model’s value of that variable to the measurements.
- A tolerance: how closely you expect the model to match it, in its own units. It is set to one fiftieth of the spread of the values when you import them. When you fit two series with different units at once, the tolerances are what make them count fairly against each other.
- An R², shown under the series and in the summary below the canvas: how much of the variation in the measurements the model explains.
Removing a series#
A series stays with the model until the stock or variable it is compared with is deleted. Importing a corrected file adds a second series rather than replacing the first, and Fit to Data uses both, so correct the file before you import it.
See also
- Fit constants to measurementsChoose what to fit, run the fit, and read the ± and R² that come back.
- Data seriesMeasurements over time, compared with a stock or variable.
- Fitting an outbreak to case dataImport daily case counts, let Fit to Data find the contact rate, and judge how far to trust it.
- Messages and what they meanEvery problem the builder reports, and what to do about it.