0

I was trying to read one csv file using;

df= pd.read_csv('Diff_Report.csv',on_bad_lines='skip',encoding='cp1252',index_col=None)

Input Example

enter image description here

But the code outputs as in the following screenshot. Why is it happening like this?

Output

enter image description here

Ammu07
  • 25
  • 5

1 Answers1

0

@Ammu07

Try using pd.read_excel()

Solution 1: - It looks like you are displaying the first 5 rows of df2

Solution 2: - Check if it is in another encoding or just utf encoding.

Solution 3: - CSV files are separated by commas, but maybe your data contains a comma, which should be cleared.

Solution 4: - Check if your data is exactly like the input or if it is separated by commas.

Tip: - Try adding index_col as id.