所要讀取表格內的數據:
代碼:
train=pd.read_csv('./1.csv')
print(train)
結果:
id sd
0 0.0 1
1 NaN 1
2 1.0 1
3 1.0 1
由輸出可知當代碼為空白時輸出為Nan。
當讀取文件只有一列內容時,空白格會被自動刪除不算作一行。