Pandas read_csv 无法读取文件无法找到文件路径FileNotFoundError: [Errno 2] No such file or directory

Pandas read_csv 无法读取文件无法找到文件路径FileNotFoundError: [Errno 2] No such file or directory的问题解决

在这里插入图片描述
如果你发现在使用Pandas时用read_csv总是无法提取文件,记得排除一种情况是:你要提取的文件在压缩文件中,需要用特殊方法进行提取。在这里插入图片描述

你可以选择将文件解压后再进行提取,如上所示!!!

或者使用如下方法来读取压缩包中的文件:
#read the dataset using the compression zip
df = pd.read_csv(‘test.zip’,compression=‘zip’)

猜你喜欢

转载自blog.csdn.net/weixin_48160438/article/details/129690927