I am trying to get the index of first occurance of each unique component names and then appending the indices to the list.
I have dataframe with around 20k rows.
mylist=[]
for i in df['name']:
mylist.append(df.loc[df.name==i].index[0])
mylist=set(mylist)
How can I speed up the above process? It takes around a minute to append to the list from dataframe.