A better way to filter dataframe using key words?
I have analysed a database of bacterial samples. I originally used this code to separate food samples from other samples, but now I must also compare the food samples to other "environmental" samples. At first, I thought I just needed to switch the selected and unselected keywords, but I now realised some rows are being left out. How should I change the code so that I can select every "non-food" row? df=pd.read_csv(path+'Raw_L_data.tsv', sep='\t') with open(path+'List_of_Foodstuff.txt', 'r') as file: lof= file.read().splitlines() with open(path+'Taboos_list.txt', 'r') as file2: tsl= file2.read
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.