因此,我正在尝试将pokemonstats csv文件转换为单独的统计信息列表。我想我知道一旦列表建立后如何将统计信息添加到标题中,但是我现在迷路了……
headers = []
stats = []
dataDict = {}
valDict = {}
with open("pokemon.csv") as file:
headers = file.readline().strip().split(",")
for lines in file.readlines():
stats.append(lines.strip().split(','))
for header in headers:
for stat in stats
valDict[stat]
'''
for idx, header in enumerate(headers):
for stat in stats:
dataDict[header] = stat[idx]
'''
将csv转换为统计信息列表