What is wrong with this saving of lists a, b to file please?
print(type(a[1]))
print(type(b))
gives
<class 'numpy.ndarray'>
<class 'numpy.ndarray'>
code:
with open("file.txt","w") as f:
for (b,a[1]) in zip(b,a[1]):
f.write("{0},{1}\n".format(b,a[1]))
error:
TypeError: object of type 'numpy.float64' has no len()
Thank you
EDIT
np.array(a.tolist())
Will lose the precision?
When I use
with open("file.txt","w") as f:
for (x,y) in zip(b,a[1]):
f.write("{0},{1}\n".format(b,a[1]))
the result is
[ 6430.032 6430.073 6430.112 ..., 6626.907 6626.948 6626.99 ],[ 0.990688 0.991408 0.993574 ..., 1.03006 1.0326 1.0325 ]
[ 6430.032 6430.073 6430.112 ..., 6626.907 6626.948 6626.99 ],[ 0.990688 0.991408 0.993574 ..., 1.03006 1.0326 1.0325 ]
[ 6430.032 6430.073 6430.112 ..., 6626.907 6626.948 6626.99 ],[ 0.990688 0.991408 0.993574 ..., 1.03006 1.0326 1.0325 ]
print of lists a and b is:
[ 0.99572325 0.9969785 0.99801075 ..., 1.0412075 1.0423975 1.0432775 ]
[ 6430.032 6430.073 6430.112 ..., 6626.907 6626.948 6626.99 ]
I would like a two columns in file - column with a and column with b as desired output.