Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python NumPy tile Function Example when (repetitions == arr.ndim) == 0

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

import numpy as np

arr = np.arange(4).reshape(2, 2)
print("arr : 
", arr)

a = 2
b = 1
repetitions = (a, b)
print("
Repeating arr : 
", np.tile(arr, repetitions))
print("arr Shape : 
", np.tile(arr, repetitions).shape)

a = 3
b = 2
repetitions = (a, b)
print("
Repeating arr : 
", np.tile(arr, repetitions))
print("arr Shape : 
", np.tile(arr, repetitions).shape)

a = 2
b = 3
repetitions = (a, b)
print("
Repeating arr : 
", np.tile(arr, repetitions))
print("arr Shape : 
", np.tile(arr, repetitions).shape)
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Python #NumPy #tile #Function #Example
ADD COMMENT
Topic
Name
9+7 =