Is there any nice way to validate that all items in a dataframe's column have a valid date format?
My date format is 11-Aug-2010
.
I saw this generic answer, where:
try:
datetime.datetime.strptime(date_text, '%Y-%m-%d')
except ValueError:
raise ValueError("Incorrect data format, should be YYYY-MM-DD")
source: https://stackoverflow.com/a/16870699/1374488
But I assume that's not good (efficient) in my case.
I assume I have to modify the strings to be pandas dates first as mentioned here: Convert string date time to pandas datetime
I am new to the Python world, any ideas appreciated.