I want to truncate the float values within the numpy array, for .e.g.
2.34341232 --> 2.34
I read the post truncate floating point but i
Use numpy.round:
import numpy as np a = np.arange(4) ** np.pi a => array([ 0. , 1. , 8.82497783, 31.5442807 ]) a.round(decimals=2) => array([ 0. , 1. , 8.82, 31.54])