Search
 
SCRIPT & CODE EXAMPLE
 

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)
Comment

PREVIOUS NEXT
Code Example
Python :: dynamically created queryset for PrimaryKeyRelatedField in drf 
Python :: printing multiple input in python 
Python :: standard destructuring assignments in python 
Python :: join items in set with newline character 
Python :: XML to MS SQL 
Python :: how to open camre aopencv 
Python :: print dataframe row horizontally 
Python :: Username and Password Login Function 
Python :: concatenate the squares of numbers in python 
Python :: deezer python download 
Python :: pydub reproduce audiosegment 
Python :: how to send one variable to python using xlwings 
Python :: change set item python 
Python :: vscode how to extend output size in jupyter notebook 
Python :: how to make a square shape in python 
Python :: python union type 
Python :: Python Print Variable Using the String Formatting with the help of % character 
Python :: open file rw python 
Python :: pandas 3d tutorail pythoin 
Python :: plot every nth label in barplot 
Python :: superpixel 
Python :: what is proc file 
Python :: c Pythagorean triples 
Python :: django graphene without model 
Python :: pandas parameters read 
Python :: bootstrap 5 in django 
Python :: how to add sum of range in python 
Python :: client.futures exchange info() 
Python :: convert python code to c online free 
Python :: python continue outer loop 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =