Комментарии:
Awsome helps alots!
ОтветитьGood Explanation.
I am attempting to convert dynamically all date columns to YYYY-MM-DD format using dataframe that come from read_csv.
input Dataframe
empno,ename,hiredate,report_date,end_date
1,sreenu,17-Jun-2021,18/06/2021,May-22
output
empno,ename,hiredate,report_date,end_date
1,sreenu,2021-06-17,2021-06-18,2022-05-31
1. if date is MMM-YY or MM-YYYY(May-22 or 05-2022) (then last day of the month(2022-05-31)
2. other than point 1 then it should be YYYY-MM-DD
Now i want create a method/function to identify all date datatype columns in dataframe then convert to YYYY-MM-DD format/user expected format.