我需要根据第一列中的ID来合并制表符分隔文件的第二列中的值。下面给出了这个例子。什么是最快的方法来做到这一点。我可以使用for循环,遍历每一行,但我确信有一些聪明的方式来做到这一点,我不知道。python:在另一列的ID的基础上合并一列中的值
596230 Other postop infection
596230 Disseminated candidiasis
596230 Int inf clstrdium dfcile
596230 Pressure ulcer, site NOS
2846079 Schizophrenia NOS-unspec
7800713 CHF NOS
7800713 Chr airway obstruct NEC
7800713 Polymyalgia rheumatica
7800713 DMII wo cmp nt st uncntr
到
596230 Other postop infection, Disseminated candidiasis, Int inf clstrdium dfcile, Pressure ulcer, site NOS
2846079 Schizophrenia NOS-unspec
7800713 CHF NOS, Chr airway obstruct NEC, Polymyalgia rheumatica, DMII wo cmp nt st uncntr