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 无法读取文件无法找到文件路径FileNotFoundError: [Errno 2] No such file or directory_第1张图片
如果你发现在使用Pandas时用read_csv总是无法提取文件,记得排除一种情况是:你要提取的文件在压缩文件中,需要用特殊方法进行提取。Pandas read_csv 无法读取文件无法找到文件路径FileNotFoundError: [Errno 2] No such file or directory_第2张图片

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

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

你可能感兴趣的:(pandas,python,数据分析)