At the moment I'm trying to write a dictionary to a file (in the same way the file is read). I thought using pandas was a good idea (since I also use it for reading of the same file), but that doesn't do what I want.
My data looks someting like this:
dict = {'x': np.array([1,2,3,4,5,etc.]), 'h': np.array([4,5,6,7,8,etc.])}
I want this data to be written to a file in the following format (since I retrieve it in this way as well):
x h
1 4
2 5
3 6
4 7
5 8
etc. etc.
I tried this, which works, but not in the way I want it:
a = pd.Series(dict)
a.to_csv(filename, sep='\t')
Any advice on how to do this (or is it easier to write it using just python?)
h [4 5 6 7 8]andx [1 2 3 4 5].