Q:

Write a NumPy program to create random set of rows from 2D array

0

Write a NumPy program to create random set of rows from 2D array.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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]]

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now