Pandas read_csv cannot read file. Unable to find file path. FileNotFoundError: [Errno 2] No such file or directory

Pandas read_csv cannot read the file and cannot find the file path FileNotFoundError: [Errno 2] No such file or directory problem solving

Insert image description here
If you find that you are always unable to extract files using read_csv when using Pandas, remember to rule out one situation: the file you want to extract is in a compressed file and needs to be extracted using a special method.Insert image description here

You can choose to unzip the file and then extract it, as shown above! ! !

Or use the following method to read the files in the compressed package:
#read the dataset using the compression zip
df = pd.read_csv('test.zip',compression='zip')

Guess you like

Origin blog.csdn.net/weixin_48160438/article/details/129690927