Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Naive Python to C with Cython
import numpy as np
def cython_multiplication(a,b):
product = np.ones(a.shape)
for row_index in np.arange(a.shape[0]):
for col_index in np.arange(a.shape[1]):
product[row_index][col_index] = a[row_index][col_index] * b[row_index][col_index]
return product
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment