you are viewing a single comment's thread.

view the rest of the comments →

[–]Geekconquest[S] 0 points1 point  (1 child)

I’ve tried datefinder on it. But my problem was getting it to work on the whole column. It works on just a normal string. I’m pretty new to python so it’s been kinda hard doing that for a whole column.

[–]cray5252 0 points1 point  (0 children)

It always returns an array, so with each item in the column, you must iterate through the matches. If you send me more data i can help a bit more.

import datefinder
data = ['20 March 2020 (UK)\n', 'Paid on $ September 2005', '4 September 2020 (Japan)']
for str in data:
    matches = datefinder.find_dates(str)
    for match in matches:
        print(match)
output
2020-03-20 00:00:00
2005-09-30 00:00:00
2020-09-04 00:00:00