Q:

Write a NumPy program to repeat elements of an array

0

Write a NumPy program to repeat elements of an array.

All Answers

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

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]

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