Cannot be separated by commas when reading csv in Pandas

Asked 2 years ago, Updated 2 years ago, 381 views

csv load

When you read csv in Pandas, you cannot separate it with commas.
As shown, column 1 appears.

I also tried the delimiter, but there is no change.

Is there anything missing?

Additional ----------------------
Line 3 and line 4.
It doesn't look like the entire line is surrounded by double quotes.

DATA No, "DATE", "TIME", "INTERVAL",

     0,2000/11/15,23:24:38,         0,  +0.07622529,  

pandas csv

2022-09-30 22:03

1 Answers

There seems to be an extra row at the beginning and it is considered as one column.
skiprows= (extra lines)

import pandas as pd
importio
csv = io.StringIO(' ''
title
aaa, bbb, cccc, dddd
100,200,300,400
'''.strip())

pd.read_csv(csv,skiprows=1)
#    aaa bbb cccc dddd
# 0  100  200   300   400


2022-09-30 22:03

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.