Writing some code numpy-style