ÂíÉÏ×¢²á£¬½á½»¸ü¶àºÃÓÑ£¬ÏíÓøü¶à¹¦ÄÜ^_^
ÄúÐèÒª µÇ¼ ²Å¿ÉÒÔÏÂÔØ»ò²é¿´£¬Ã»ÓÐÕ˺ţ¿Á¢¼´×¢²á
x
ÕâÊÇÓйØ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 [2]:
import pandas as pd
import numpy as np
Step 3. Use the tsv file and assign it to a dataframe called food¶
In [3]:
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: [Errno 2] File /root/Desktop/en.openfoodfacts.org.products.tsv does not exist: '/root/Desktop/en.openfoodfacts.org.products.tsv'
ÓãÓÑÃÇ°ïæ¿´¿´°É
|