This is how my pandas data frame looks like.My requirement is to combine utterances column based on User_type and sorted by Chat_sequence_number and group them by case_id and Interaction_id
Case_ID Interaction_ID Chat_Sequence_Number User_Type Utterances
1 123 3 Person1 are
1 123 4 Person1 you
1 123 1 Person1 Hello,
1 123 2 Person1 how
1 123 5 Person1 feeling?
1 123 6 Person2 I'm
1 123 6 Person2 fine.
Is there a way that i can create a new data frame based on the requirements above. My final Output should look like this
Case_ID Interaction_ID User_Type utterance 1 123 Person1 Hello,how are you feeling? 1 123 Person1 I'm fine.