I’m trying to print the complete contents of two 1001×1 arrays, but Python only gives me truncated output something like this:
array([[5,45],
[1,23],
......,
[1,24],
[2,31]])
instead of the complete array.
Can anyone give me solution of how to get the complete 1001×1 array?
I’m going to guess that you tried a simple statement like:
… rather than something more explicit like:
… or even:
The reason you’re seeing elided output is, presumably, because
numpyimplements a_str_method in itsarrayclass which tries to give a “reaasonable” defaultstring representation of the array. They are, presumably, assuming that simple
printstatements will be used primarily for debugging, logging, or similar purposes and that reporting of results, or marshaling of results to other processes or storage, is going to be done using more explicit iterations over the data (as I’ve shown here).