Reputation: 1047
Hey guys im trying to import text file into an array using numpy but it looks like when it imported them with the rows as cols and vice versa. Am I formatting the array wrong or is that what happnened?
I added a picture below:
Upvotes: 1
Views: 1592
Reputation: 6441
Its because you set unpack=True
, unpack transposes your array.
From the numpy documentation:
unpack : bool, optional
If True, the returned array is transposed, so that arguments may be
unpacked using x, y, z = loadtxt(...). When used with a record data-type,
arrays are returned for each field. Default is False.`
If you set it to false, it wont transpose the array.
Upvotes: 3