# welcome to softhunt.net
# Python program explaining
# numpy.broadcast_to() function
# importing numpy as np
import numpy as np
arr = np.array([5, 6, 7, 8, 9, 10])
softhunt = np.broadcast_to(arr, (6, 6))
print(softhunt)
# welcome to softhunt.net
# import numpy
import numpy as np
# using Numpy.broadcast_arrays() method
arr1 = np.array([[1, 2]])
arr2 = np.array([[3], [4]])
print(np.broadcast_arrays(arr1, arr2))
numpy.broadcast_to(array, shape, subok = False)
# welcome to softhunt.net
# Python program explaining
# numpy.broadcast_to() function
# importing numpy as np
import numpy as np
arr = np.array([9, 7, 4])
softhunt = np.broadcast_to(arr, (3, 3))
print(softhunt)
Numpy.broadcast_arrays()
# welcome to softhunt.net
# import numpy
import numpy as np
# using Numpy.broadcast_arrays() method
arr1 = np.array([[1, 2], [3, 4]])
arr2 = np.array([[5, 6], [7, 8]])
print(np.broadcast_arrays(arr1, arr2))