Move use of numpy to inside function.