Are not the two codes completely different?
In Julia you have a for j in 1:n
and for i in 1:m
inside for iter in 1:niters
. In Python you select a single index in the range 1:N
to do something over it. The Julia algorithm is cubic, the Python algorithm is linear.