我有一个CSV文件,格式如下。假设空格是逗号分隔的。你知道吗
slot0 slot1
Serial Timestamp Height Width Score Height Width Score ....
FA125 2015_05 215.00 125.01 156.02 235.23 862.23 135.52 ....
这种情况会持续数千行,并重复许多槽#的这种模式。槽#与“高度、宽度和分数”相关,槽的中心是谁。也就是说,slot0对应于第一个高度、宽度和分数,slot1对应于第二个高度、宽度和分数。每个插槽有三个测量值。你知道吗
我很难找到最好的方法把这些数据放到1.数据帧我将槽号与特定的高度、宽度和分数相关联,但特别是序列号或时间戳。你知道吗
我曾经想到过这样的事情,但我是否能做得更好还不清楚。你知道吗
Serial Timestamp s0_Height s0_Width s0_Score s1_Height s1_Width s1_score ....
FA125 2015_05 215.00 125.01 156.02 235.23 862.23 135.52 ....
在这种情况下似乎有点尴尬,但如果这是唯一的办法,我想我可以管理。你知道吗
# Maybe something like this?
pd.DataFrame({'FSJ1503007N-ct0': ['20150311_021738', 140, 123, 213]}, ['timestamp', 's0_height', 's0_score', 's0_width'])
请记住,我可以以任何方式修改CSV来实例化数据帧,但问题是我不确定用这个数据创建数据帧的最佳方式。你知道吗
谢谢!你知道吗
这实际上取决于你想对你的数据做什么样的计算。你知道吗
如果您只是跳过第一行,您的csv将被读入为:
可能足够满足你的需要了。你知道吗
相关问题 更多 >
编程相关推荐