0
votes

what I am trying: url ='https://github.com/Anubhav1107/Machine_Learning_A-Z/blob/master/Part%202%20-%20Regression/Section%205%20-%20Multiple%20Linear%20Regression/50_Startups.csv'

dataset = pd.read_csv(url)

and what I am getting:


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

1 Answers

3
votes

Use this instead.

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

Otherwise you'll just get the HTML, not the CSV.