I have Pandas Data Frame in Python like below:
VAL
--------
99050605188
00102255789
20042388956
02111505667
Values are in str format.
First 6 numbers means date, for example:
- 99050605188 --> 1999-05-06
- 00102255789 --> 2000-10-22
- 20042388956 --> 1920-04-23
Be aware that:
- if value in column "VAL" starts with 0 it will be year 2000 +, for example 001203... ---> 2000-12-03, 021115...--> 2002-11-15
- if value in column "VAL" starts with 9,8,7,6,5,4,3,2,1 it will be year 1900+, for example 200423... --> 1920-04-23
So as a result I need something like below (column "Date" in str format):
VAL date
---------------------------
99050605188 | 1999-05-06
00102255789 | 2000-10-22
20042388956 | 1920-04-23
02111505667 | 2002-11-15
How can I do that in Python Pandas ?