I am using to analyse a .csv
files which only contains two columns:
- date
- time_taken
A snipped of the csv
is:
date,time_taken
01-02-2019,2.3
02-02-2019,3.3
03-02-2019,2.8
04-02-2019,4.5
05-02-2019,1.2
06-02-2019,6.7
I am getting this ValueError
:
ValueError: time data 'date' does not match format '%d-%m-%Y' (match)
The Python 3.6
snipped is:
import pandas as pd
transfer = pd.read_csv('tcs1_time.csv', header=None, delimiter=',')
transfer.columns = ['date', 'time_taken']
transfer['date'] = pd.to_datetime(transfer['date'], format='%d-%m-%Y')
The date in csv
matches the format
, however, I am getting this ValueError
.
Can anyone help in this regard? thanks.