convert arrary to int

Solutions on MaxInterview for convert arrary to int by the best coders in the world

showing results for - "convert arrary to int"
Ally
20 May 2017
1>>> x = np.array([[1.0, 2.3], [1.3, 2.9]])
2>>> x
3array([[ 1. ,  2.3],
4       [ 1.3,  2.9]])
5>>> x.astype(int)
6array([[1, 2],
7       [1, 2]])
8