Skip to content

Instantly share code, notes, and snippets.

@goog
Created July 17, 2013 01:40
Show Gist options
  • Save goog/6016971 to your computer and use it in GitHub Desktop.
Save goog/6016971 to your computer and use it in GitHub Desktop.
from numba import autojit
import numpy as np
@autojit
def sum1d(my_double_array):
sum = 0.0
for i in range(my_double_array.shape[0]):
sum += my_double_array[i]
return sum
a = np.array([1.0, 2.0])
print sum1d(a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment