I have a Pandas dataframe A which has this form:  id attributeA  1  [A,B,C]  2  [A,C,D]  3  [B,C]  a dataframe B containing the unique values in the list of attribute A id name  1  A  2  B  3  C  4  DI need to create this dataframe:idA idB  1   1  1   2  1   3  2   1  2   3  2   4  3   2  3   3   This is what I do (Very very slow....):for dfA_id, dfA_row in dfA.iterrows():    dfA_atrib_list = dfA_row[attributeA]    for elem in dfA_atrib_list:        dfB_id = dfB[dfB['name']==elem]['id'][0]        dfC=dfC.append({dfA_id: dfA_id, dfB_id:dfB_id}, ignore_index=True)What could I do to optimize this code ?Thank you !
Pandas : DF A contains list of element, DF B contains all the unique elements of A. Need to store their id faster
python;performance;beginner;pandas