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

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

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -