search for the date cells in dataframe to change format

Viewed 23

i have some excel files here is a sample of one of the files

I Want to change the format of the dates, but the problem is not all the files have the same format and pattern, and doesn't have names for the columns, therefore i would like to search dynamicaly for the dates and change them, i know how to do when i know the position of the data but in my case i don't know how to do it

file = pd.read_excel('b.xlsx')
file = file.astype(str)
file = file.drop(file.index[:8])

file= file.replace({'2020': '20'}, regex=True)  
file = file.iloc[:, 0]

file = pd.to_datetime(file)
file = file.dt.strftime("%m/%d/%y")
0 Answers
Related