I am currently learning Python language for Data Science. While Practicing some of the problems I came across a year related problem with Python.
I have a dataframe in datelooks like
0 2061-01-01
1 2061-01-02
2 2061-01-03
3 2061-01-04
.
.
.
8 1978-12-29
9 1978-12-30
10 1978-12-31
I am required to convert the years 2061 to 1961.
Here is what I tried
def check( x ):
if (x > 1978):
x=x-100
print(x)
else:
print(x)
S1=S1.apply(check)
S1
For some reason, the function is running fine but when I am trying to apply it on the series S1, I am getting output with values None in place of the corrected date
Kindly suggest where I am getting wrong.
Thanks