Fortran Reshape Function In Python