我有一个文本文件(带制表符分隔),例如:
Plate Well Group Type Sample Wavelength Reading Abs Meas. Time [s]
Plate 1 A05 Assay Blank Blank_Assay 1/1 340 1 0.113 0.080
Plate 1 A05 Assay Blank Blank_Assay 1/1 340 2 0.114 3.660
Plate 1 A05 Assay Blank Blank_Assay 1/1 340 3 0.114 7.230
Plate 1 A01 Assay Control Ctrl_0001 1/1 340 1 0.706 0.000
Plate 1 A01 Assay Control Ctrl_0001 1/1 340 2 0.706 3.580
Plate 1 A01 Assay Control Ctrl_0001 1/1 340 54 0.685 189.740
Plate 1 B01 Assay Control Ctrl_0002 1/1 340 4 0.698 11.220
等等。在
我用\t
分隔符将其拆分并访问所有单独的列。在
我想让它给我
^{pr2}$我希望时间按时间顺序从0到>最高数字排序,在每个时间,将相应的吸光度读数添加到相应的列(带标题)。在
我希望最后的输出被输出到一个新的文件。在
这对我有用:
你说:
查看您最初发布的完整数据(在被编辑截短之前),您将无法根据
Meas. Time [s]
列匹配abs读数,因为A05、A01和B01的每个读数都不相同。相反,(我想?)Reading
数字列是连接各个读数的方法,因为Meas. Time [s]
对于所有井的每个读数编号都是相似的。在因此,使用Python csv模块,读取文件并按} 完成的。在
Reading
列对数据进行分组。然后按顺序迭代分组读数,为每个Well
获取Abs
的值。分组是使用dicts的^{从CSV文件中读取数据后,
^{pr2}$data
如下所示:最后,遍历字典(按读数排序)并输出abs值。最终输出应如下所示:
相关问题 更多 >
编程相关推荐