I am new to python and I need a help on formatting an array and storing it in a file.
I have an array say
a = [['C', [0.99813803, -0.00263872, -0.00464602]], ['H', [2.0944175, -0.00242373, 0.00417336]], ['H', [0.63238996, 1.03082951, 0.00417296]], ['H', [0.62561232, -0.52974905, 0.88151021]], ['H', [0.64010219, -0.50924801, -0.90858051]]]
Now I want to store it in a file in the following manner
C 0.99813803 -0.00263872 -0.00464602
H 2.0944175 -0.00242373 0.00417336
H 0.63238996 1.03082951 0.00417296
H 0.62561232 -0.52974905 0.88151021
H 0.64010219 -0.50924801 -0.90858051
I tried numpy.savetxt but it stores in array format. I know with, regex I can remove all the special characters, but for me the problem lies only in writing line by line from the array.
Can anyone tell me instead of numpy.savetxt what else I can try ?