python numpy floor

Solutions on MaxInterview for python numpy floor by the best coders in the world

showing results for - "python numpy floor"
Giulio
22 Jan 2017
1# Python program explaining
2# floor() function
3  
4import numpy as np
5  
6in_array = [.5, 1.5, 2.5, 3.5, 4.5, 10.1]
7print ("Input array : \n", in_array)
8  
9flooroff_values = np.floor(in_array)
10print ("\nRounded values : \n", flooroff_values)
11  
12  
13in_array = [.53, 1.54, .71]
14print ("\nInput array : \n", in_array)
15  
16flooroff_values = np.floor(in_array)
17print ("\nRounded values : \n", flooroff_values)
18  
19in_array = [.5538, 1.33354, .71445]
20print ("\nInput array : \n", in_array)
21  
22flooroff_values = np.floor(in_array)
23print ("\nRounded values : \n", flooroff_values)