Answers for "initiate np array"

1

python numpy array size of n

numpy.array([0] * n) #creates an int64 numpy array of size n with each element having a vaule of 0
numpy.array([0] * n, dtype = '<type>') #creates a numpy array of size n with a type of <type>
Posted by: Guest on October-07-2020
-1

initialize np array

an_array = np.empty((2, 2))
Posted by: Guest on May-19-2021
0

numpy init array

a=[]
for i in range(8):
    a.append(i)
Posted by: Guest on October-22-2020

Python Answers by Framework

Browse Popular Code Answers by Language