The numpy array: Solutions

The numpy array: Solutions

Create a 1-dimensional array of ones

arr_1d=np.ones(10)

Create a 2-dimensional array of random numbers

rand_2d=numpy.random.random((5,5))

Create a 10 x 10 2-dimensional numpy array of ones of float type

ones_2d=numpy.ones((10,10),float)

Task 4: Create a 10 x 10 2-dimensional numpy array of zeros of integer type

zeros_2d=numpy.zeros((10,10), int)

Previous