df:
Col_A Month
0 March 2020 Mar
1 March 20 Mar
2 Ebg 2020 Mar
3 17 GOFE Mar
4 APR 17 Mar
5 16 HGN Nov
6 2015 ref May
7 18Jun Jul
How to replace digit from a string variable in a pandas data frame, for example, I need to replace digits in Col_A with 2019 or 19. if digit count or length in col_A is 4 then 2019 else 19.
Output:
Col_A Month
0 March 2019 Mar
1 March 19 Mar
2 Ebg 2019 Mar
3 19 GOFE Mar
4 APR 19 Mar
5 19 HGN Nov
6 2019 ref May
7 19Jun Jul