Reputation: 95
I want to restrict a number to certain decimal places. For e.g: 0.973451 to 4 decimal places would be 0.9374.Note: The numbers I want to restrict are in numpy array - type Float64
I'm performing operations on numbers that have many digits after decimal places. When I perform mathematical operations like multiplication or exponential, it shows "overflow error".
Upvotes: 1
Views: 59
Reputation: 2095
Use the round method in numpy.
numpy.round_(a, decimals=0, out=None)
Upvotes: 2