I have a pandas data frame (showing values of one of the rows) as below. In the annotation column, I have a list of strings which I want to check in the note_sentence column which contains sentences.
I used the below code to check the existence but it is unable to capture the existence of strings in the sentences.
df_feature_case_notes['Exists'] = df_feature_case_notes.apply(lambda x: 'Yes' if x['annotation'] in x['note_sentence'] else 'No',axis=1)
How can I fix my code?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.