Jun-25-2021, 04:37 PM
Hi,
this code works fine:
I tried with numpy.savetxt()
Thanks
m.
this code works fine:
import numpy as np
data = np.array([3,2,55,4])
for i in range(4):
data[i] = data[i]+3
print("text before", data[i], "text after")Output:Output:~/pro$ python max.py
('text before', 6, 'text after')
('text before', 5, 'text after')
('text before', 58, 'text after')
('text before', 7, 'text after')But I can't save in the file output.txt.I tried with numpy.savetxt()
np.savetxt("output.txt", ???, fmt='%i', delimiter=",")What should i add in this code?Thanks
m.
