how to make a numpy array

Solutions on MaxInterview for how to make a numpy array by the best coders in the world

showing results for - "how to make a numpy array"
Lara
22 Feb 2019
1>>> np.arange(10)
2array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
3>>> np.arange(2, 10, dtype=float)
4array([ 2., 3., 4., 5., 6., 7., 8., 9.])
5>>> np.arange(2, 3, 0.1)
6array([ 2. , 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9])
7