I am using cclib to parse some data from an output file. Using the below code:
filename = "calc.out"
data = cclib.io.ccread(filename)
print (data.grads)
I get the below output:
[[[-1.6510e-04 -4.4360e-04 -3.0450e-04]
[ 4.8228e-03 3.2300e-05 1.0200e-05]
[-1.9796e-03 -3.5266e-03 -2.6463e-03]
[-1.6856e-03 4.7508e-03 -1.7005e-03]
[-1.8385e-03 -9.7510e-04 4.8117e-03]]]
What I would like to do is convert the output to the below format:
-1.6510e-04
-4.4360e-04
-3.0450e-04
.
.
.
4.8117e-03
How would I do this with python? Please let me know if you need any additional information, I am new to asking questions and python. Thanks in advance for the help!