如何在python中读取文件
你可以使用 pd.read_csv
import pandas as pd
data = pd.read_csv('test', sep=' ', header=None)
print(data)
给你
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
0 00001069: 04 33 c0 eb 42 53 8b 1e 6b 0 6a 4 6a 2 6a 0
1 00001078: 6a 2 68 00 0 0 70 68 38 30 00 10 ff 15 08 20
你也可以标记列
data.columns = ['Code', 'Elem 1', 'Elem 2', 'Elem 3', 'Elem 4', 'Elem 5', 'Elem 6', 'Elem 7', 'Elem 8',
'Elem 9', 'Elem 10', 'Elem 11', 'Elem 12', 'Elem 13', 'Elem 14', 'Elem 15', 'Elem 16']
print(data)
这个:
Code Elem 1 Elem 2 Elem 3 ... Elem 13 Elem 14 Elem 15 Elem 16
0 00001069: 04 33 c0 ... 6a 2 6a 0
1 00001078: 6a 2 68 ... ff 15 08 20
赞0
踩0