python - Comparing two lists of strings and getting indices of duplicates -


i want indices of values (strings) duplicated. example:

a=['iii','jjj','rrr'] b=['iii','lll','yyy','ttt','jjj']     s=numpy.where(a==b) 

i want s return [0,4], @ moment returns [0] same value , in same position in list.

use numpy.where numpy.in1d:

>>> np.where(np.in1d(b, a))[0] array([0, 4] 

Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

php - Improving script execution time -

How to provide Authorization & Authentication using Asp.net, C#? -