import numpy into function definition