Moved numpy import to top of module rather than in each function