How do I save numpy arrays such that they can be loaded later appropriately?
How about ndarray's .tofile() method? To read use numpy.fromfile().
I have a code which outputs an N-length Numpy array at every iteration. 
Eg. -- theta = [ 0, 1, 2, 3, 4 ]
I want to be able to save the arrays to a text file or .csv file dynamically such that I can load the data file later and extract appropriately which array corresponds to which iteration. Basically, it should be saved in an ordered fashion.
I am assuming the data file would look something like this:-
0 1 2 3 4
1 2 3 4 5
2 3 4 5 6 ... (Random output)
I thought of using np.c_ but I don't want to overwrite the file at every iteration and if I simply save the terminal output as > output.txt, it saves as arrays including the brackets. I don't know how to read such a text file.
Is there a proper method to do this, i.e. write and read the data?