I/O Helper classes¶
- pints.io.load_samples(filename, n=None)[source]¶
Loads samples from the given
filenameand returns a 2d NumPy array containing them.If the optional argument
nis given, the method assumes there arenfiles, with names based onfilenamesuch that e.g.test.csvwould becometest_0.csv,test_1.csv, …,test_n.csv. In this case a list of 2d NumPy arrays is returned.Assumes the first line in each file is a header.
See also
save_samples().
- pints.io.save_samples(filename, *sample_lists)[source]¶
Stores one or multiple lists of samples at the path given by
filename.If one list of samples is given, the filename is used as is. If multiple lists are given, the filenames are updated to include
_0,_1,_2, etc.For example,
save_samples('test.csv', samples)will store information fromsamplesintest.csv. Usingsave_samples('test.csv', samples_0, samples_1)will store the samples fromsamples_0totest_0.csvandsamples_1totest_1.csv.See also:
load_samples().