I have a numpy array that looks like this:
[[41.743617 -87.626839]
[41.936943 -87.669838]
[41.962665 -87.65571899999999]]
I want to round the numbers in the array to two decimal places, or three. I tried using numpy.around and numpy.round, but both of them give me the following error:
File "/Library/Python/2.7/site-packages/numpy-1.8.0.dev_3084618_20130514-py2.7-macosx-10.8-intel.egg/numpy/core/fromnumeric.py", line 2452, in round_
return round(decimals, out)
AttributeError: rint
i used numpy.around(x, decimals = 2)
and numpy.round(x,decimals=2)
Am I doing something wrong? Is there any other way to do this efficiently for a large array?
print your_array? This will help us understand thedtypeof the array. - SethMMorton