All examples
Data

Exact decimal CSV columns

Read the supplied decimal prices without binary rounding, select exact values and choose an explicit Float64 export.

decimal_csv.aner
import aner.data

let schema = data.schema().column("item", "String", false)
    .column("price", "Decimal", false)
let scan = data.scan_csv("examples/fixtures/decimal.csv", schema, "NA")
let table = scan.collect(max_rows: 0, max_bytes: 1048576, batch_rows: 2)
let prices: Array<Decimal> = table.decimal_values("price")
print(table.decimal(0, "price"))
print(prices.get(0) + prices.get(1) == D("0.30"))
print(prices.sum() == D("9007199254740993.31"))
print(type(prices.mean()))
print(scan.filter(data.col("price") >= D("0.20"))
    .collect(0, 1048576, 2).rows())

let matrix = prices.reshape(shape: List(1, 3))
print(matrix.sum() == prices.sum())
let detached = prices.astype("Float64")
print(type(detached))

Make it your experiment.

Use a compatible Aner runtime. Save this program as examples/decimal_csv.aner inside a folder for your experiment. Open a terminal in that folder, then check and run the program.

Terminal
aner check examples/decimal_csv.aner
aner run examples/decimal_csv.aner

The aner command must be on your PATH. Follow the installation guide if your terminal cannot find it.

Use a compatible current native Aner executable. This complete example runs locally with the declared inputs; the guide explains exact shapes, expected results and resource limits. 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
Install Aner