关于pandas:我无法将github数据链接上传到Google Colab

I am not able to upload the github data link to Google Colab

我正在尝试什么:
url ='https://github.com/Anubhav1107/Machine_Learning_A-Z/blob/master/第2部分-回归/第5节-多元线性回归/50_Startups.csv'

1
dataset = pd.read_csv(url)

以及我得到的是:

  • ParserError Traceback (most recent call last) in ()
    1 url ='https://github.com/Anubhav1107/Machine_Learning_A-Z/blob/master/Part%202%20-%20Regression/Section%205%20-%20Multiple%20Linear%20Regression/50_Startups.csv'
    ----> 2 dataset = pd.read_csv(url)

3 frames /usr/local/lib/python3.6/dist-packages/pandas/io/parsers.py
in read(self, nrows) 1993 def read(self, nrows=None): 1994
try:
-> 1995 data = self._reader.read(nrows) 1996 except StopIteration: 1997 if self._first_chunk:

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

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

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

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

pandas/_libs/parsers.pyx in pandas._libs.parsers.raise_parser_error()

ParserError: Error tokenizing data. C error: Expected 1 fields in line
75, saw 7


改为使用此。

1
url = 'https://raw.githubusercontent.com/Anubhav1107/Machine_Learning_A-Z/master/Part%202%20-%20Regression/Section%205%20-%20Multiple%20Linear%20Regression/50_Startups.csv'

否则,您将只获取HTML,而不是CSV。