I have a dataframe,
DF,
Name Stage Description
Sri 1 Sri is one of the good singer in this two
2 Thanks for reading
Ram 1 Ram is one of the good cricket player
ganesh 1 good driver
and a list,
my_list=["one","driver"]
I tried, names=df.loc[df["Description"].str.contains("|".join(my_list),na=False), 'Name']
achieved everything except the keyvalue column.
output_DF.
Name Stage Description
Sri 1 Sri is one of the good singer in this two
Ram 1 Ram is one of the good cricket player
My desired output is,
desired_DF,
Name Stage Description keyvalue
Sri 1 Sri is one of the good singer in this two one
2 Thanks for reading
Ram 1 Ram is one of the good cricket player one
ganesh 1 good driver driver
some one help me with generating keyvalue column