Numpy translation of MATLAB assignments