I want to check if a passed function is a Numpy function or not. for example:
import numpy as np
def my_func(passed_func):
if passed_func is Numpy function: # Here is the problem
print('It is')
else:
print('It is not')
>>>> my_func(np.random.randn)
>>>> It is
>>>> my_func(np.random.randint)
>>>> It is
>>>> my_func(lambda x : x+2)
>>>> It is not
Thanks in advance :)