#Import the NumPy library
import numpy as np

#Creating two 1D arrays
a = np.array([1, 2, 3])
b = np.array([4, 5, 6])

#Building the cartesian product
c = np.transpose([np.tile(a, len(b)), np.repeat(b, len(a))])

#Printing results
print(c)