ParserError: Error tokenizing data. C error: Expected 1 fields in line 48, saw 2

getiing this error while executing
import pandas as pd
df=pd.read_csv(‘https://github.com/coding-blocks-archives/machine-learning-online-2018/tree/master/Datasets/MNIST-2/mnist_train.csv’)

Hey @aakashsharma845, I suggest you to download the csv file , save it on your local machine and then give the path of the csv file saved on your local PC, to this pd.read_csv() function.

I hope this helps !
Happy Learning :slight_smile:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

In most cases, it might be an issue with:

  • the delimiters in your data.
  • confused by the headers/column of the file.

The error tokenizing data may arise when you’re using separator (for eg. comma ‘,’) as a delimiter and you have more separator than expected (more fields in the error row than defined in the header). So you need to either remove the additional field or remove the extra separator if it’s there by mistake. The better solution is to investigate the offending file and to fix it manually so you don’t need to skip the error lines.