My Excel file has dates looking like "Mar-21" to mean March of the year 2021. However, when I use pandas.read_excel() as shown in the following code snippet, the output displays dates with the current year, but sets the years that were in Excel as days of the month.
Shape of Source data:
Code snippet for reading the file:
df = pd.read_excel(
io=input_excel_file,
parse_dates=date_columns,
date_parser=lambda x: pandas.to_datetime(x, format="%b-%y"))
Preview of the resulting DataFrame:
How do I get read_excel or Pandas to recognize that the digits in May-22 are for the year 2022, for example? Thanks in advance!
Update: Running pandas.read_excel() without the parse_dates and date_parser parameters, the code snippet looks like this:
df = pd.read_excel(
io=input_excel_file,)
and results in the following output:


