Review and load an unfamiliar CSV
Infer wide types and physical units, accept a schema and retain reproducible cleaning and source evidence.
// Synthetic sensors. Run from the directory containing examples/fixtures.
// Review the recommendation before using an unfamiliar source scientifically.
import aner.data
import aner.units
let proposed = data.infer_csv("examples/fixtures/data_modern.csv",
missing: "NA", memory_bytes: 8388608, sample_rows: 0)
print(data.schema_description(proposed))
let source = data.scan_csv("examples/fixtures/data_modern.csv", proposed, "NA")
// Fill is a declared source-unit literal; normalization follows its source unit.
// This teaching constant is not a learned imputation estimate.
let filled = data.fill_missing(source, "Temperature_DegC", "21.0")
let normalized = data.convert_unit(filled, "Distance_cm", "m")
let complete = data.drop_missing(normalized)
let report = data.summarize(complete, max_bytes: 8388608, batch_rows: 2)
print("Complete selected rows")
print(data.rows(report))
print("Mean temperature in degC")
print(data.unit_mean(report, "Temperature_DegC", "degC").value())
print("Execution and source identity")
print(data.provenance(report))
// Zero removes the row quota; retained rows automatically spill as RAM fills.
let table = data.collect(complete, max_rows: 0, max_bytes: 8388608, batch_rows: 2)
print(data.text(table, 0, "ObservationID"))
print(data.datetime_ns(table, 0, "RecordedAt"))
// For datasets larger than RAM, stream selected rows to a fresh disk path:
// let saved = data.write_csv(complete, "clean-sensors.csv", 8388608, 4096)
// print(data.provenance(saved))
Make it your experiment.
Use Aner 0.0.5 or newer. Save this program as examples/data_modern.aner inside a folder for your experiment. Open a terminal in that folder, then check and run the program.
aner check examples/data_modern.aner
aner run examples/data_modern.anerThe aner command must be on your PATH. Follow the installation guide if your terminal cannot find it.
Requires the native Aner 0.0.5 or newer and VS Code 0.1.48 candidate integration. These APIs require Aner 0.0.5 or newer. Save supplied fixtures in the shown working directory paths. No external service or credentials are required for the included analysis. Save each supplied fixture beneath the exact examples/fixtures path shown in the source and run from the project root.
Bundled datasets retain their own source attribution and license notices. Example outcomes are not comparative benchmarks or evidence of clinical validity.
Dataset sources & attribution