I have a 100*100 array in python and I used:
f.open(file_name) and f.write(matrix_name) to write it in this file. Actually the matrix was written in the file but in this format:
[[ 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 8 91 1
.
.
.]
[ 7 8 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 22 3 4 5 6 6
.
.
.]
[ .
.
.
]]
so my problem that each row from the matrix was written in many rows in the file (e.g. row 1 was written in 17 rows in the file), because I need each row in the matrix printed in one row in the file.. so totally I need a 100 row in the file, not more than the 100 rows.
numpyarrays here? Thenumpylibrary has several options of writing data from an array to a file for you, rather than just dumping the text representation into a file.