I have a DataFrame:
df = pd.DataFrame(data=[676, 0, 670, 0, 668], index=['2012-01-31 00:00:00','2012-02-29 00:00:00',
'2012-03-31 00:00:00','2012-04-30 00:00:00',
'2012-05-31 00:00:00'])
df.index.name = "Date"
df.columns = ["Number"]
Which looks like:
Number
Date
2012-01-31 00:00:00 676
2012-02-29 00:00:00 0
2012-03-31 00:00:00 670
2012-04-30 00:00:00 0
2012-05-31 00:00:00 668
How can i input 2nd and 4th values with (676+670)/2 and (670+668)/2 correspondinly?
I can save values as np.array
and imput them in array, but that's rediculous!