io_utils.py

io_utils.py handles CSV file loading and centralizes the validation choices related to missing columns, field renaming, and NaN handling.

Main imports

  • Standard library: collections.abc.Collection, collections.abc.Mapping, pathlib.Path, typing.Literal

  • External libraries: pandas as pd

  • Types defined in the module: MissingPolicy = Literal["error", "drop", "allow"]

What it exports

  • load_csv: wrapper di pandas.read_csv con un contratto piu piccolo e prevedibile.

Module responsibilities

  • read a CSV file from a string path or Path

  • support configurable separators and decimal separators

  • rename columns immediately after loading

  • check any required columns

  • choose the missing-value policy explicitly

Relations with the rest of the package

io_utils.py is the entry point for turning on-disk data into a DataFrame that can then be passed to the functions in stats_utils, plot_utils, and fit_utils.

Detailed page