It is very easy to compare two lists in python, but it seems not so many people know it.

Just use the `==` symbol in numpy, it will return a numpy array with boolean value, True means the position are idential.

import numpy as np

aa = [“a”,”b”,”a”]
bb = [“b”,”b”,”a”]

np.array(aa)==np.array(bb)

>>array([False, True, True], dtype=bool)

see my example code in stackoverflow:

http://stackoverflow.com/a/36983379/3279996

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.