2021年3月18日星期四

Create new data frame from pairwise from another

How do I create a new pandas data frame from an existing one using a column pairwise. For example I have a data frame like this. The original data frame is image one.

Original Data Frame

I want to create a new data frame that takes the first sequence as the source and the second sequence as the target till the end of the conversation id. For the person column I want to grab the person who said the source and for the type it should be the type of the conversation id.

Resulting Data Frame

enter image description here

I want the data frame to end up looking like image two.

https://stackoverflow.com/questions/66701497/create-new-data-frame-from-pairwise-from-another March 19, 2021 at 09:46AM

没有评论:

发表评论