當前位置:成語大全網 - 新華字典 - jupyter notebook中怎麽讀取excel內容

jupyter notebook中怎麽讀取excel內容

首先將excel文件另存為csv格式文件;

然後在jupyter notebook中寫入以下代碼:

import csv

filename = "C:/Users/Administrator/Desktop/0515.csv"?

with open(filename) as f:

reader = csv.reader(f)

for row in reader:

print(reader.line_num,row)

註意:filename中的文件名和位置記得轉為自己電腦對應下的文件名及位置