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 are n files, with names based on filename such that e.g. test.csv would become test_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 from samples in test.csv. Using save_samples('test.csv', samples_0, samples_1) will store the samples from samples_0 to test_0.csv and samples_1 to test_1.csv.

See also: load_samples().