I have data in following format
Month Country BA Total
11/1/2018 CN 3 10
after reading Month comes as object though I want in date format, I tried to convert it in date time format using
hs = pd.read_csv('history.csv',parse_dates=['Month']) #this is not solving the issue either
hs['Month'] = pd.to_datetime(hs['Month']) #this throws error
Please suggest me how to read it as date or convert it to date format
pd.to_datetimehas no issues with parsing mm/dd/yyyy to datetime correctly. You can seterrors='coerce'to skip the errors, but that will leave "NaT" for those elements in the datetime column.