Answers for "Python NumPy tile Function Example"

0

Python NumPy tile Function Example

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

import numpy as np

arr = np.arange(3)
print("arr : \n", arr)

a = 2
b = 2
repetitions = (a, b)
print("\nRepeating arr : \n", np.tile(arr, repetitions))
print("arr Shape : \n", np.tile(arr, repetitions).shape)

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

a = 2
b = 3
repetitions = (a, b)
print("\nRepeating arr : \n", np.tile(arr, repetitions))
print("arr Shape : \n", np.tile(arr, repetitions).shape)
Posted by: Guest on April-25-2022

Python Answers by Framework

Browse Popular Code Answers by Language