python 为什么我收到“文件找不到”错误,即使我已经下载了csv文件,并指定了路径?[关闭]

iswrvxsc  于 2023-05-05  发布在  Python
关注(0)|答案(1)|浏览(110)

**关闭。**这个问题是not reproducible or was caused by typos。目前不接受答复。

此问题是由打印错误或无法再重现的问题引起的。虽然类似的问题可能是on-topic在这里,这一个是解决的方式不太可能帮助未来的读者。
1小时前关闭
Improve this question
这是我的代码:

time_series = pd.read_csv(r'C:\Users\megue\Downloads\WHO-COVID-19-global-data.csv', encoding = 'ISO-8859-1')
time_series['Date_reported'] = pd.to_datetime(time_series['Date_reported'])

收到此错误消息:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\megue\\Downloads\\WHO-COVID-19-global-data.csv'

nimxete2

nimxete21#

尝试删除(r 'C:/ users)之前的r
转到您的文件资源管理器和右键单击和复制路径文件名,以确保您得到根路径,这可能会工作

time_series = pd.read_csv('C:\\Users\\megue\\Downloads\\WHO-COVID-19-global-data.csv', encoding='ISO-8859-1')

试试看

相关问题