Q:

Filling missing gap with "NAN"

l have a few years data set but some of values are missing.l would like to fill these rows with "NAN" 
here is  an example data:
year    month   day min
2011    1   1   -2.3
2011    1   2   -9.1
2011    1   3   -4.7
2011    1   4   -3.5
2011    1   6   -1.4
2011    1   7   0.1
2011    1   9   -6.3
2011    1   10  -9.4
2011    1   11  -13.3
2011    1   12  -17.9
2011    1   14  -11.8
2011    1   15  -11.2
2011    1   16  -7.1
2011    1   17  -7.6
2011    1   18  -9.9
2011    1   20  -6.9
2011    1   21  -8.8
2011    1   22  -11.3
2011    1   24  -3.1
2011    1   25  -0.7
2011    1   26  0.8
2011    1   27  -0.9
2011    1   28  -6.9
2011    1   29  -3.2
2011    1   30  -2.3
2011    1   31  -7

as you see ,in first month of 2011 , many value missing and l need to open a row for this values and then fill. is there any way to do it ? 

A:

You need reindex by MultiIndex.from_arrays created by date_range:
start = '2011-01-01'
end = '2011-01-31'

rng = pd.date_range(start, end)
mux = pd.MultiIndex.from_arrays([rng.year, rng.month, rng.day], names=('year','month','day'))

df = df.set_index(['year','month','day'])

print (df.reindex(mux).reset_index())

    year  month  day   min
0   2011      1    1  -2.3
1   2011      1    2  -9.1
2   2011      1    3  -4.7
3   2011      1    4  -3.5
4   2011      1    5   NaN
5   2011      1    6  -1.4
6   2011      1    7   0.1
7   2011      1    8   NaN
8   2011      1    9  -6.3
9   2011      1   10  -9.4
10  2011      1   11 -13.3
11  2011      1   12 -17.9
12  2011      1   13   NaN
13  2011      1   14 -11.8
14  2011      1   15 -11.2
15  2011      1   16  -7.1
16  2011      1   17  -7.6
17  2011      1   18  -9.9
18  2011      1   19   NaN
19  2011      1   20  -6.9
20  2011      1   21  -8.8
21  2011      1   22 -11.3
22  2011      1   23   NaN
23  2011      1   24  -3.1
24  2011      1   25  -0.7
25  2011      1   26   0.8
26  2011      1   27  -0.9
27  2011      1   28  -6.9
28  2011      1   29  -3.2
29  2011      1   30  -2.3
30  2011      1   31  -7.0

