import numpy as np from pathlib import Path path = Path("sensor-readings.csv") readings = np.array( [[18.25, 42.0, 0.98], [18.50, 41.5, 0.99], [18.75, 41.0, 1.01]], dtype=np.float64, ) np.savetxt( path, readings, delimiter=",", header="temperature,humidity,calibration", comments="", fmt="%.2f", ) print(path.read_text().strip()) loaded = np.loadtxt(path, delimiter=",", skiprows=1) print("shape:", loaded.shape) print("dtype:", loaded.dtype) print("values match rounded export:", np.allclose(loaded, np.round(readings, 2)))