Skip to content

Instantly share code, notes, and snippets.

@umitkacar
Last active September 29, 2021 14:46
Show Gist options
  • Save umitkacar/71a9f14b57c1795ddeafe4ed26e1f6c7 to your computer and use it in GitHub Desktop.
Save umitkacar/71a9f14b57c1795ddeafe4ed26e1f6c7 to your computer and use it in GitHub Desktop.
import numpy as np
x = [6,7,8]
y = np.expand_dims(x, axis=0)
my = [1,2,3]
mx = [4,5,6]
yx = np.tensordot(my,mx,0)
res = np.where(yx == 1)
np.column_stack((res[0], res[1], res[2], res[3]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment