Guided Project: Exploring Ebay Car Sales Data [Reading of CSV]

Screen Link:
https://app.dataquest.io/m/294/guided-project%3A-exploring-ebay-car-sales-data/1/introduction

My Code:
import pandas as pd
autos=pd.read_csv(“autos.csv”,“Latin-1”)
autos.info()

What I expected to happen:
Read the csv to autos without any warnings, and get a summary of 10+ columns using autos.info()

What actually happened:
Got the following errors on running autos=pd.read_csv("autos.csv","Latin-1")
/dataquest/system/env/python3/lib/python3.4/site-packages/ipykernel/main.py:2: ParserWarning: Falling back to the ‘python’ engine because the ‘c’ engine does not support regex separators (separators > 1 char and different from ‘\s+’ are interpreted as regex); you can avoid this warning by specifying engine=‘python’.
*** from ipykernel import kernelapp as app***

also after running autos.info()
the entire data is getting saved in a single column

Will appreciate if someone can help me with this.
Cheers…

HI @veeral27596, welcome to the community!

This is an easy fix! When specifying the encoding for the csv file, use encoding="Latin-1". It looks like without the keyword, it’s interpreting "Latin-1" as a delimiter for the file. (In the documentation, the first argument is for the file path ('autos.csv') and the second one is for the type of separator).

2 Likes

oh, what a silly mistake! thanks for the help though!

Hi,
I’m having the same issue, but am getting the error even when I put encoding="Latin-1". I’m wondering if I need to specify the file path.

eBay_Car_Sales.ipynb (10.0 KB)

Click here to view the jupyter notebook file in a new tab

I think it’s autos.csv not auto.csv?

3 Likes

It sure is. Thanks! (need to type at least 20 chars in this box for some reason)