1

I get strange error when trying to read csv file in colab, however no error appears when I do it on Jupiter notebook with same dataframe. Here is the error:

ParserError: Error tokenizing data. C error: EOF inside string starting at row 75397

When I do pd.read_csv("train.csv") on Jupiter it works perfectly, but in colab this error appears. How to fix it?

Ir8_mind
  • 842
  • 5
  • 9

1 Answers1

0

This happened to me. What happens is that it's reading the HTML encoded file. This is how I solved it:

  1. Open the GitHub repository page in your web browser.
  2. Click on the dataset file you want to read from the GitHub repository. A preview of the file will open.
  3. You will find a "Raw" button close to the upper right corner of the file preview. ...
  4. Copy this URL and paste in your google colab using this code.

import pandas as pd df = pd.read_csv('https://raw.githubusercontent.com/<username>/publicfile.csv')

Chapin
  • 169
  • 1
  • 7