I have a column in a data frame called new_new_column (apologies for the poor name) that consists of lists of strings such as [a, b, i, l] and [a, ɡ, i, l]. Separately, I have a list of characters called “sharedlist” that is a list of characters [‘h’, ‘p’, ‘ɡ’, ‘ʧ’, ‘s’, ‘ʃ’, ‘f’,…]. I want to go through every row of new_new_column and if every character in a given row of new_new_column appears in sharedlist, I want to add the name that appears in the column Name to a new list called NewList. The following code does not work in Streamlit (there is an empty list that is produced). Do you have recommendations on how to do this?
NewList = [df['Name'].iloc[i] for i,nc_val in enumerate(df['new_new_column']) if set(nc_val).issubset(sharedlist)]