From 1048f1f416c7395a27e233a677326fafc8fcbcaf Mon Sep 17 00:00:00 2001 From: Humphrey Yang Date: Tue, 24 Oct 2023 22:44:54 +1100 Subject: [PATCH] check the type of the function --- lectures/numba.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lectures/numba.md b/lectures/numba.md index 693e8c28..c8c05d27 100644 --- a/lectures/numba.md +++ b/lectures/numba.md @@ -272,6 +272,8 @@ def mean(data): data = np.array([2.3, 3.1, 4.3, 5.9, 2.1, 3.8, 2.2]) n_resamples = 10 +print('Type of function:', type(mean)) + #Error try: bootstrap(data, mean, n_resamples) @@ -286,6 +288,8 @@ But Numba recognizes JIT-compiled functions def mean(data): return np.mean(data) +print('Type of function:', type(mean)) + %time bootstrap(data, mean, n_resamples) ```