2016-04-02 9 views
0
import pandas as pd 

path = r'‪C:\Users\matt\Documents\sample.csv' 
sample = pd.read_csv(path) 

print sample 

IOError: File ‪C:\Users\matt\Documents\sample.csv does not existパンダが私のCSVを読むことができないのはなぜですか?

私が試した:

r'‪C:/Users/matt/Documents/sample.csv' 
'‪C:/Users/matt/Documents/sample.csv' 
'C:\\Users\\matt\\Documents\\sample.csv' 

をすべてsameresultをもたらします。

Proof that the file exists.

+0

os.path.exists(パス)がfalseを返します! – Mateyobi

+0

'print(path)'とは何ですか? – MaxU

+0

パス= r'C:\ユーザー\マット\ドキュメント\ sample.csv ';プリントパス。言うC:マット\ドキュメント\ \ Users \ユーザーsample.csv – Mateyobi

答えて

0

私のCの前にゴミが問題でした。

‪

このゴミは、パスに入れたコピーペーストに由来しています。ファイルパスに

手タイピングは、問題を解決しました。

関連する問題