Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Get the positions of items of ser2 in ser1 as a list python

ser1 = pd.Series([10, 9, 6, 5, 3, 1, 12, 8, 13])
ser2 = pd.Series([1, 3, 10, 13])

pos = []
for i in range(len(ser2)):
    for j in range(len(ser1)):
        if ser2[i] == ser1[j]:
            pos.append(j)
 
PREVIOUS NEXT
Tagged: #Get #positions #items #list #python
ADD COMMENT
Topic
Name
8+3 =