我有一个巨大的文件,有上千行,看起来像这样:
`C509.TCGA-78-7159-10A-01D-2036-08.1-C509. 1 0 0 1 0 0
C509.TCGA-78-7159-10A-01D-2036-08.1-C509. 0 1 1 0 1 1`
如果行的第一列匹配,我想将一行的第二列与第二行的第二列相加,第三列与第三列相加,等等,不使用pandas。也许最好使用python,而不是awk,因为它的大小。你知道吗
输出应为:
C509.TCGA-78-7159-10A-01D-2036-08.1-C509. 1 1 1 1 1 1
感谢您的帮助:)
您可以使用以下内容:
输入的输出是:
如果将数据作为列表列表加载到Python中,可以执行以下操作
这将为您提供一个字典,其中包含每个唯一的第一个值和其他列的总和。你知道吗
相关问题 更多 >
编程相关推荐