How to pass Numpy value to expression formula

I can define a function by python, the input and output are all numpy, now I want to pass this function to the expression formula, how can I make it ?

Please produce a minimal working code that illustrates your usecase.