Write a NumPy program to create random set of rows from 2D array.
import numpy as np new_array = np.random.randint(5, size=(5,3)) print("Random set of rows from 2D array array:") print(new_array)
Sample Output:
Random set of rows from 2D array array: [[4 0 2] [4 2 4] [1 0 4] [4 4 3] [3 4 3]]
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer