Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python NumPy tile Function Example Working with 1D array

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

import numpy as np

#Working on 1D
arr = np.arange(5)
print("arr : 
", arr)

repetitions = 2
print("Repeating arr 2 times : 
", np.tile(arr, repetitions))

repetitions = 3
print("
Repeating arr 3 times : 
", np.tile(arr, repetitions))
# [0 1 2 ..., 2 3 4] means [0 1 2 3 4 0 1 2 3 4 0 1 2 3 4]
# since it was long output, so it uses [ ... ]
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Python #NumPy #tile #Function #Example #Working #array
ADD COMMENT
Topic
Name
9+6 =