Hi Matthieu, I thought as much, regarding the computations, but was just presenting the information.
Thanks for the set_printoptions but it doesn't seem to apply when accessing a specific item: >>> numpy.set_printoptions(precision=12) >>> port_result.agg_matrix[0] array([ 2.115495680000e+08, 4.037352320000e+08, 8.474664000000e+07, 3.996256000000e+07, 7.998535500000e+06, 6.682471000000e+06, 0.000000000000e+00, 1.000187900000e+07, 3.430652000000e+07, 1.752612400000e+07, 4.892464500000e+06, 2.065627875000e+06], dtype=float32) >>> port_result.agg_matrix[0][11] 2065627.9 No change in the vale output from a specific item in the matrix. Am I missing something? Hanni 2008/9/3 Matthieu Brucher <[EMAIL PROTECTED]> > Hi, > > I can't help you with the first issues, but the display has nothing to > do with the quality of the computation. Numpy only prints a part of a > float value, but fir the computations, it obviously uses the correct > value. All this can be parametrized by using set_printoptions(). > > Matthieu > > 2008/9/3, Hanni Ali <[EMAIL PROTECTED]>: > > Hi, > > > > I have encountered a worrying problem, during migration of software from > > numarray to numpy, perhaps someone could help me determine how this could > be > > addressed. > > > > I have a large array or values 10000 long 12 items per line. The matrix > > contains floats, dtype=float32 in numpy and type=Float32 in numarray. > > > > When I perform a mean of one of the columns we observe a discrepancies in > > the output values. > > > > numarray: > > >>> port_result.agg_matrix._array[::,2].mean() > > 193955925.49500328 > > > > numpy: > > > > >>> port_result.agg_matrix._array[::,2].mean() > > 193954536.48896 > > > > If we examine a specific line in the matrix the arrays appear identical: > > > > numarray: > > >>> port_result.agg_matrix[0] > > array([ 2.11549568e+08, 4.03735232e+08, 8.47466400e+07, > > 3.99625600e+07, 7.99853550e+06, 6.68247100e+06, > > 0.00000000e+00, 1.00018790e+07, 3.43065200e+07, > > 1.75261240e+07, 4.89246450e+06, 2.06562788e+06], > type=Float32) > > > > numpy: > > >>> port_result.agg_matrix[0] > > array([ 2.11549568e+08, 4.03735232e+08, 8.47466400e+07, > > 3.99625600e+07, 7.99853550e+06, 6.68247100e+06, > > 0.00000000e+00, 1.00018790e+07, 3.43065200e+07, > > 1.75261240e+07, 4.89246450e+06, 2.06562788e+06], > dtype=float32) > > > > However when examining a specific item numpy appears to report a value to > 8 > > significant figures regardless of the true value, whereas numarray > reported > > the full value, however if I cast the output as a float the full value is > > present, just not being output. Could this explain the difference in the > > mean values? How can I get numpy to always provide the exact value in the > > array, so behave in the same manner as numarray? > > > > numarray: > > >>> port_result.agg_matrix[0][4] > > 7998535.5 > > >>> port_result.agg_matrix[0][11] > > 2065627.875 > > > > numpy: > > >>> port_result.agg_matrix[0][4] > > 7998535.5 > > >>> port_result.agg_matrix[0][11] > > 2065627.9 > > >>> float(port_result.agg_matrix[0][4]) > > 7998535.5 > > >>> float(port_result.agg_matrix[0][11]) > > 2065627.875 > > > > I appreciate any help anyone can give, thank you. > > > > Hanni > > > > > > > > _______________________________________________ > > Numpy-discussion mailing list > > Numpy-discussion@scipy.org > > http://projects.scipy.org/mailman/listinfo/numpy-discussion > > > > > > > -- > French PhD student > Information System Engineer > Website: http://matthieu-brucher.developpez.com/ > Blogs: http://matt.eifelle.com and http://blog.developpez.com/?blog=92 > LinkedIn: http://www.linkedin.com/in/matthieubrucher > _______________________________________________ > Numpy-discussion mailing list > Numpy-discussion@scipy.org > http://projects.scipy.org/mailman/listinfo/numpy-discussion >
_______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion