I have a for loop creating a matrix every time and I need to write all the matrices to a text file
I used np.savetxt()in the for loop, but in the end, the textfile only shows the last matrix I created.
Does anyone know what happened?
file = open("newfile.txt", "w")
for i in range (0,5):
matrix = numpy.zeros((5, 5))
np.savetxt(file, matrix)
file.close()