I have a CSV file (example below), that I'm trying to load into a dataframe and have pandas automatically parse the dates.
"http://www.example.com","http://example.com","test",2016-06-16,2016-02-21,4
When I load this file specifying the columns to be parsed, they are successfully loaded as datetimes:
df = pd.read_csv(inputfile, parse_dates=[3,4])
However I don't know that these dates will always be columns 3 & 4, so I wanted it to attempt to parse each column and see if it's a date, my understanding from the pandas docs, was this is accomplished by:
df = pd.read_csv(inputfile, parse_dates=True)
However this loads columns 3 & 4 as objects. Presumably I have misunderstood this. Is there a correct way to do this? Do I need to load the dataframe and then try to convert each column to a date?
(I'm running Canopy with Python 2.7.11 -- 64-bit on Windows 10)