0

I exported a matrix of 127x127 values as a txt, but the output appears as

 answer:[[  44.    1.    0. ...,   12.   13.    2.]
 [  51.    7.    0. ...,    5.   14.    4.]
 [   0.    1.    4. ...,    0.    0.    1.]
 ..., 
 [  22.  110.   70. ...,    5.    0.    0.]
 [  12.   36.   12. ...,    0.    0.    2.]
 [   0.    0.    0. ...,   24.  177.   53.]]

I need access to all values, as input on Support Vector Machines

Thank You

Ashwini Chaudhary
  • 244,495
  • 58
  • 464
  • 504
user2967127
  • 41
  • 1
  • 8

2 Answers2

4

Use numpy.set_printoptions to change the number of items returned when the array is printed.

>>> import numpy as np
>>> a = np.arange(127*127).reshape(127, 127)
>>> np.set_printoptions(edgeitems=127)
>>> print a

As expected this will flood your screen.

Ashwini Chaudhary
  • 244,495
  • 58
  • 464
  • 504
2

I'm guessing you're using numpy. If that's the case, I suggest you use the savetxt() function (http://docs.scipy.org/doc/numpy/reference/generated/numpy.savetxt.html).

Daniel
  • 695
  • 7
  • 20