Extracting a date at the end of a pandas dataframe
row.split(", ")[-1] is the string 23/09/2012, now you can use the date module to extract that into a Date object. And use try/except for error handling.
I have a column of data that is in the following format:
bla bla bla, bla bla bla, bla bla bla, bla bla bla bla bla bla, 23/09/2012
Is there an easy way to extract the date at the end of the string from all rows? It is in the same DD/MM/YYYY format every time.
I could split on the last , but it would be good if I could specify that I want the date in case of errors in the data.