Help with array multiplication

I aware that to multiple arrays, dimensions should match as:
A: array of (x,y) , B: array of (y,z)

In Python below is working fine:

X = np.array([  
        [0,0,1],
        [0,1,1],
        [1,0,1],
        [1,1,1] 
    ])

syn0 = 2*np.random.random((3,1)) - 1

z = np.dot(X,syn0)

I tried to replicate it in Julia as:

# input dataset
X = [ [0,0,1],
      [0,1,1],
      [1,0,1],
      [1,1,1] 
    ]

syn0 = 2 * rand(3,1)

z = X * syn0

But I got the below error:

DimensionMismatch("matrix A has dimensions (4,1), matrix B has dimensions (3,1)")

You’re very close, the issue is in your construction of X. If you instead write it as

X = [0 0 1
     0 1 1
     1 0 1
     1 1 1]

everything else should work:

julia> z = X * syn0
4×1 Array{Float64,2}:
 0.21256890671577544
 1.1955791336979948 
 1.6645297812021584 
 2.647540008184378