Answers for "makming an np array of 1 to 10 python"

3

create an array from 1 to n python

a_list = list(range(1, 5))

print(a_list)
[1,2,3,4,5]
Posted by: Guest on September-13-2020
7

np.arange in python

>>> np.arange(3)
array([0, 1, 2])
>>> np.arange(3.0)
array([ 0.,  1.,  2.])
>>> np.arange(3,7)
array([3, 4, 5, 6])
>>> np.arange(3,7,2)
array([3, 5])
Posted by: Guest on July-09-2020

Code answers related to "makming an np array of 1 to 10 python"

Python Answers by Framework

Browse Popular Code Answers by Language