Python vectorizing nested for loops Python vectorizing nested for loops numpy numpy