Skip to content

Commit

Permalink
check the type of the function
Browse files Browse the repository at this point in the history
  • Loading branch information
HumphreyYang committed Oct 24, 2023
1 parent e528eb9 commit 1048f1f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lectures/numba.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
```

Expand Down

0 comments on commit 1048f1f

Please sign in to comment.