根据值合并列的某些值

时间:2018-11-19 08:43:12

标签: python pandas

我有一个像这样的熊猫数据框

fileNo    fileName    value    
    1       file1       He       
    1       file1       is       
    1       file1       the           
    1       file1       boss   
    2       file2        It
    2       file2        is
    2       file2        a
    2       file2        doge

我想合并value列中的某些列,以使结果看起来像这样。

fileNo    fileName    value    
    1       file1       He is the boss       
    2       file2       It is a doge

如何使用熊猫来做到这一点?我不知道如何使用融化或堆叠之类的现有实用程序来做到这一点。

0 个答案:

没有答案
相关问题