date parser python pandas

mydateparser = lambda x: pd.datetime.strptime(x, "%Y %m %d %H:%M:%S")
df = pd.read_csv("file.csv", sep='\t', names=['date_column', 'other_column'], parse_dates=['date_column'], date_parser=mydateparser)

Here is what the above code is Doing:
1. The first line defines a function that takes a string and returns a datetime object.
2. The second line reads the CSV file into a DataFrame.
3. The third line tells Pandas to use the function we defined in step 1 to parse the dates in the ‘date_column’.