I have a sorted dataset by datestamp which looks like this:
user message A Hi. B Hello. B How are you? A I am stuck. B How can I help you?
What I want is to create a pandas df that would look like this:
user message reply A Hi. Hello. A Hi. How are you? B Hello. I am stuck. B How are you? I am stuck. A I am stuck. How can I help you?
For each message, I want to find all of the replies. That means that I want the messages after current one but from the other user. How can I do this with pandas? Let's only consider a binary case of 2 users A and B.