Feb-12-2018, 04:51 PM
Dear Python Experts,
I got a series that looks the following:
9 71
14 1990
10 85
I want to append 19 to the 2 digit numbers and
then sort by index so it should be
1 1
2 3
3 2
So far I managed to loop through the series but somehow the series values dont change.
I got a series that looks the following:
9 71
14 1990
10 85
I want to append 19 to the 2 digit numbers and
then sort by index so it should be
1 1
2 3
3 2
So far I managed to loop through the series but somehow the series values dont change.
def years(): for n in nonan: if len(n)<3: n='19'+n #nonan.sort_values(axis=0,ascending=False, inplace=True) return nonan years()