Multiple string formatting while writing an array into a file
18 Oct
2009
18 Oct
'09
1:03 p.m.
Hello, I have a relatively simple question which I couldn't figure out myself yet. I have an array that I am writing into a file using the following savetxt method. np.savetxt(fid, output_array, fmt='%12.4f', delimiter='') However, I have made some changes on the code and I require to write after 7th element of the array as integer instead of 12.4 formatted float. The change below doesn't help me to solve the problem since I get a "ValueError: setting an array element with a sequence." np.savetxt(fid, (output_array[:7], output_array[7:]), fmt=('%12.4f', '%12d'), delimiter='') What would be the right approach to fix this issue? Thanks. -- Gökhan
5294
Age (days ago)
5295
Last active (days ago)
1 comments
1 participants
participants (1)
-
Gökhan Sever