There are 2 columns for example...
This is my original data frame
quote: ['Originally Posted by Gilly Is it? Hmmmm. I enjoy randomness. It changes my mood. I guess not everyone responds the same way. ;)']
all_post: ['Originally Posted by Gilly Is it? Hmmmm. I enjoy randomness. It changes my mood. I guess not everyone responds the same way. ;) Ah ok.. maybe I didn't understand.. /animal crawls back in its hole']
I would like to separate the sentence
"Ah ok.. maybe I didn't understand.. /animal crawls back in its hole"
into another column
This is what I have tried
def extract_post(Quote,Post):
post = [x for x in all_post if x not in quote]
return post
for j,row in confession.iterrows():
if type(row['quote']) == float:
continue
else:
print(extract_post(row['quote'], row['all_post']))
But the result for the 2nd was ['A', 'k', "'", '/', 'k'] (basically it compares each character)