''' I am writing a code in pandas. Stuck on the below part where I need to use missing rows. ''' df
A B C D E E G H
0 US BENIN 1995 5 10 15 40
1 US BENIN 1996 6 12 12 12
2 US BENIN 2000 4 13 12 12
3 US Hungary 1998 5 19 23 23
4 US Hungary 1999 3 23 12 3
5 UK Chile 2000 5 10 15 40
6 UK Chile 2002 6 12 12 12
7 UK Chile 2004 4 13 12 12
8 UK Iceland 2004 5 19 23 23
89UK Iceland 2005 3 23 12 3
''' I want to add blank rows for missing years from 1995 to 2000 in between these rows using a loop ''' Desired output:
A B C D E F G H
0 US BENIN 1995 5 10 15 40
1 US BENIN 1996 6 12 12 12
2 US BENIN 1997
3 US BENIN 1998
4 US BENIN 1999
5 US BENIN 2000 4 13 12 12
6 US BENIN 2001
7 US BENIN 2002
8 US BENIN 2003
9 US BENIN 2004
10US BENIN 2005
11US Hungary 1995
12US Hungary 1996
13US Hungary 1997
14US Hungary 1998 5 19 23 23
15US Hungary 1999 3 23 12 3
16US Hungary 1999
17US Hungary 2000
18US Hungary 2001
19US Hungary 2002
20US Hungary 2003
21US Hungary 2004
22US Hungary 2005
23UK Chile 1995
24UK Chile 1996
25UK Chile 1997
26UK Chile 1998
27UK Chile 1999
28UK Chile 2000 5 10 15 40
29UK Chile 2001
30UK Chile 2002 6 12 12 12
31UK Chile 2003
32UK Chile 2004 4 13 12 12
33UK Chile 2005
:
:
:
:
43 UK Iceland 2004 5 19 23 23
44 UK Iceland 2005 3 23 12 3
9 US BENIN 2004), sort the DataFrame, remove duplicates which have missing values and then reset index?