Home > other >  Pandas, please read the CSV file, time format problems lead to the column index don't correspon
Pandas, please read the CSV file, time format problems lead to the column index don't correspon

Time:09-20

Everyone a great god, small white consult
Use python processing excel data and drawing, recently discovered pandas read_csv function is good, but just a question, this is I write program and print the form results , this is the original form of the  , you can see, the last three columns of data index and the value of the column in the originally, after the test, to excel in the time that listed out, you can print form it is normal, could you tell me the great spirit so what should I do

CodePudding user response:

CSV file is a space-delimited data?

The CSV file format cut a figure to see,

CodePudding user response:

Make the CSV XLSX format to read again

CodePudding user response:

I tried, seemingly didn't you of that kind of situation,
When you try to import the time that column into time format (parse_dates parameters), and see if I can solve? Code:
Data_csv=pd. Read_csv (r 'C: \ Users \ Desktop \ test CSV', parse_dates=[' t1 '], index_col=0)

CodePudding user response:

Misunderstanding misunderstanding, I understand the wrong question, because the first column of the index of reading is not the value of the first column, behind each column of the index were wrong, change the first column of the index on the