1476372787 发表于 2021-1-25 21:05:22

为什么报错

这是有关pandas的作业:
Step 1. Go to https://www.kaggle.com/openfoodfacts/world-food-facts/data
Step 2. Download the dataset to your computer and unzip it.
In :
import pandas as pd
import numpy as np
Step 3. Use the tsv file and assign it to a dataframe called food¶
In :
food = pd.read_csv('~/Desktop/en.openfoodfacts.org.products.tsv', sep='\t')
运行到这步后就出错了,报错如下:
IOErrorTraceback (most recent call last)
<ipython-input-13-489f4e8333cb> in <module>()
----> 1 food = pd.read_csv('~/Desktop/en.openfoodfacts.org.products.tsv', sep='\t')

4 frames
/usr/local/lib/python2.7/dist-packages/pandas/io/parsers.pyc in __init__(self, src, **kwds)
   1851         kwds['usecols'] = self.usecols
   1852
-> 1853         self._reader = parsers.TextReader(src, **kwds)
   1854         self.unnamed_cols = self._reader.unnamed_cols
   1855

pandas/_libs/parsers.pyx in pandas._libs.parsers.TextReader.__cinit__()

pandas/_libs/parsers.pyx in pandas._libs.parsers.TextReader._setup_parser_source()

IOError: File /root/Desktop/en.openfoodfacts.org.products.tsv does not exist: '/root/Desktop/en.openfoodfacts.org.products.tsv'
鱼友们帮忙看看吧{:10_281:}

私はり 发表于 2021-1-26 14:50:54

文件不存在
页: [1]
查看完整版本: 为什么报错