Manipal King
Manipal King

Reputation: 420

How to get Numerical Readable Output of Float dtype in Numpy Array?

I have a list like :

print x
>>> [1, 1, 1, 1, 3]
>>> [25, 375, 25, 100, 425]
>>> [17742.05, 17742.0, 17738.1, 17738.05, 17738.0]
>>> [17744.0, 17744.6, 17744.65, 17744.95, 17745.0]
>>> [475, 25, 50, 25, 650]
>>> [3, 1, 2, 1, 4]

but when i convert it to a numpy array , it prints out like this (can i use some datatype to make is appear just as the list).

y=np.asarray(x)
>>> [[  1.00000000e+00   1.00000000e+00   1.00000000e+00   1.00000000e+00
3.00000000e+00]
>>> [  2.50000000e+01   3.75000000e+02   2.50000000e+01   1.00000000e+02
4.25000000e+02]
>>>  [  1.77420500e+04   1.77420000e+04   1.77381000e+04   1.77380500e+04
1.77380000e+04]
>>>  [  1.77440000e+04   1.77446000e+04   1.77446500e+04   1.77449500e+04
1.77450000e+04]
>>>  [  4.75000000e+02   2.50000000e+01   5.00000000e+01   2.50000000e+01
6.50000000e+02]
>>> [  3.00000000e+00   1.00000000e+00   2.00000000e+00   1.00000000e+00
4.00000000e+00]]

As these values change every second , can i have some way to transfer this array into an bigger array(for larger time frame), something like appending a list to another list.

Upvotes: 0

Views: 110

Answers (1)

Rob
Rob

Reputation: 538

Try turning off the scientific notation in numpy.

numpy.set_printoptions(suppress=True)

Upvotes: 2

Related Questions