Pandas: combine columns without duplicates/ find unique words after combining
问题 I have a dataframe where I would like to concatenate certain columns. My issue is that the text in these columns may or may not contain duplicate information. I would like to strip out the duplicates in order to retain only the relevant information. For example, if I had a data frame such as: pd.read_csv("animal.csv") animal1 animal2 label 1 cat dog dolphin 19 2 dog cat cat 72 3 pilchard 26 koala 26 4 newt bat 81 bat 81 I want to combine the columns but retain only unique information from