my csv dataset has date column as datatype= object. I have to change that to date time. to do so i use the following code.
train=pd.read_csv(r"C:\train.csv")
train['Date'] = pd.to_datetime(train.Date,format='%Y-%d-%m')
This gives me error as below
ValueError: unconverted data remains: 2
It looks like 2 of these data might not be in actual order eg. may be 2020-02-14, is as 2020-14-02 or so. I have 17000 rows and manually it is impossible to catch 2 data.
Question is how do I correct it ? How to find which data is creating problem.