Skip to content

Instantly share code, notes, and snippets.

@previtus
Created October 12, 2017 21:37
Show Gist options
  • Save previtus/51476095518816d6c87ca9ba19a1fb8f to your computer and use it in GitHub Desktop.
Save previtus/51476095518816d6c87ca9ba19a1fb8f to your computer and use it in GitHub Desktop.
a = "/home/ekmek/saliency_tools/models/TEST1.npy"
b = "/home/ekmek/saliency_tools/models/TEST2.npy"
aval = np.load(a)
bval = np.load(b)
# lengths
print len(aval)
print len(bval)
for i in range(0,len(aval)):
print i, len(aval[i]), len(bval[i])
# one by one (clearer with big arrays) check if they are the same inside, convert to list
from deepdiff import DeepDiff
for i in range(0,len(aval)):
tmp = aval[i]
tmp = tmp.tolist()
print type(tmp)
tmp2 = bval[i]
tmp2 = tmp2.tolist()
print i, DeepDiff(tmp, tmp2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment