Python-合并B列,其中A列重复

时间:2018-06-26 08:36:31

标签: python pandas

我在数据框(df)中有一些数据:

    Reference   Description
0   C11621/2    The findings have been used
1   B01026/1    Findings from this research
2   D01469/1    The PopChange web resource 
3   AM0156/1    The whole project was designed 
4   AM0156/1    The data set has been used 
5   AM0156/1    This project has become one 

'Reference'列中可能有重复项,如果存在,我想将数据合并在一起仅形成一行,即在上面的数据框中,以下3行具有重复的参考号:

    Reference   Description
3   AM0156/1    The whole project was designed  ...
4   AM0156/1    The data set has been used ...
5   AM0156/1    This project has become one ...

我想把它变成:

    Reference   Description
3   AM0156/1    The whole project was designed The data set has been used This project has become one

那怎么办?

0 个答案:

没有答案