Simple vectorization examples in numpy