How can I check if all multiple strings existing in another string?
Then assign the result to a new column named "value".
Example of the dataframe:
| sub_strings | string | value |
|---|---|---|
| ["the sun", "rising up"] | "the sun is rising up." | True |
| ["go home", "tomorow"] | "I will go home." | False |
My code is:
if all(x in df["string"] for x in df["sub_strings"]):
df['value'] = True
else:
df['value'] = False
Could you please help me? Thank you in advance.