How to accelerate the application of the following for loop and function? How to accelerate the application of the following for loop and function? numpy numpy