1

This is the file created as temp.cvs

temp.csv

I've made the above file into temp.csv. Then ran the following.

df=pd.read_csv("temp.csv")
df

Then I got

ParserError: Error tokenizing data. C error: Expected 1 fields in line 9, saw 5

So I tried

df=pd.read_csv("temp.csv",error_bad_lines=False)
df

and got.

{\rtf1\ansi\ansicpg1252\cocoartf1504\cocoasubrtf840

0 {\fonttbl\f0\fnil\fcharset0 HelveticaNeue;}

1 {\colortbl;\red255\green255\blue255;\red53\gre...

2 {*\expandedcolortbl;;\cssrgb\c27059\c27059\c2...

3 \paperw11900\paperh16840\margl1440\margr1440\v...

4 \deftab560

5 \pard\pardeftab560\slleading20\partightenfactor0

I still do not know what the problem is... Please HELP me...

abhilb
  • 5,639
  • 2
  • 20
  • 26
Scotty Jung
  • 19
  • 1
  • 1
  • 4

2 Answers2

7

To fix that you need to add the separator in the code:

df = pd.read_csv("temp.csv", sep=";")

JIsam
  • 91
  • 2
  • 7
0

Can you try this:

df = pd.read_csv('temp.csv',sep='\t',
                  lineterminator='\r',
                  error_bad_lines=False)