Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

How can I Duplicate 1 Dimensional array

# welcome to softhunt.net
# Python Program illustrating
# numpy.repeat()

import numpy as np

np_array_1d = np.array([1,2,3,4])
np_array_2d = np.expand_dims(np_array_1d, axis = 0)
ans = np.repeat(a = np_array_2d, repeats = 2, axis = 0)
print(ans)
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #How #I #Duplicate #Dimensional #array
ADD COMMENT
Topic
Name
5+8 =