I/O Helper classes¶
- pints.io.load_samples(filename, n=None)[source]¶
Loads samples from the given
filename
and returns a 2d NumPy array containing them.If the optional argument
n
is given, the method assumes there aren
files, with names based onfilename
such that e.g.test.csv
would 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 fromsamples
intest.csv
. Usingsave_samples('test.csv', samples_0, samples_1)
will store the samples fromsamples_0
totest_0.csv
andsamples_1
totest_1.csv
.See also:
load_samples()
.