Skip to content

read_csv builtin

read_csv(path, *, nodata=None, delimiter=',', units=None)

Reads a headed CSV; numbers become float64, nodata values become null.

Parameters:

Name Type Description Default
path str or Path

The file.

required
nodata sequence of float or str

Values read as null. Numbers match numerically (-999 matches -999.0), strings match tokens case-insensitively. Default -99, -999, 1e21 and text such as NA, N/A or NULL. Empty cells are always null.

None
delimiter str

Single-byte field separator.

","
units dict of str to str

Column name to unit for columns that have none; the defaults of set_units fill the rest.

None
Notes

A header such as au [g/t] or au (g/t) reads as column au with unit g/t when the bracket holds a unit.

used in