我尝试在 Python 中读取 CSV 文件,但第一行中的第一个元素是这样读取的0
,而奇怪的字符不在文件中,它只是一个简单的0
. 这是我使用的代码:
matriceDist=[]
file=csv.reader(open("distanceComm.csv","r"),delimiter=";")
for row in file:
matriceDist.append(row)
print (matriceDist)
Run Code Online (Sandbox Code Playgroud)
小智 12
I had this same issue. Save your excel file as CSV (MS-DOS) vs. UTF-8 and those odd characters should be gone.
归档时间: |
|
查看次数: |
4953 次 |
最近记录: |