0

I try to import csv file using pandas. The csv was uploaded to dropbox, you can access:

import pandas as pd
csv_path = "https://www.dropbox.com/s/hulf1rqntmwepql/training_3.csv?dl=0"
data = pd.read_csv(csv_path, sep=',')

and get the following error message:

CParserErrorTraceback (most recent call last)
<ipython-input-44-bf00f19b4b83> in <module>()
      1 csv_path = "https://www.dropbox.com/s/hulf1rqntmwepql/training_3.csv?dl=0"
----> 2 data = pd.read_csv(csv_path, sep=',')

pandas/parser.pyx in pandas.parser.TextReader.read (pandas/parser.c:7988)()

pandas/parser.pyx in pandas.parser.TextReader._read_low_memory (pandas/parser.c:8244)()

pandas/parser.pyx in pandas.parser.TextReader._read_rows (pandas/parser.c:8970)()

pandas/parser.pyx in pandas.parser.TextReader._tokenize_rows (pandas/parser.c:8838)()

pandas/parser.pyx in pandas.parser.raise_parser_error (pandas/parser.c:22649)()

CParserError: Error tokenizing data. C error: Expected 1 fields in line 4, saw 3

1 Answer 1

1

DropBox used the dl= flag to tell it whether it should auto-trigger download or if it should display a UI prompting a user to download.

Right now you're getting a download prompt, try https://www.dropbox.com/s/hulf1rqntmwepql/training_3.csv?dl=1 instead.

Sign up to request clarification or add additional context in comments.

1 Comment

Was it trying to create a DF object out of alert box?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.