Write a NumPy program to repeat elements of an array.
import numpy as np x = np.repeat(3, 4) print(x) x = np.array([[1,2],[3,4]]) print(np.repeat(x, 2))
Sample Output:
[3 3 3 3] [1 1 2 2 3 3 4 4]
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