Dear All:
I have a daily price series. but some values in the price is NA and i want to replace it with that month's mean price value. I tried to run a for and if loop, but fail to deal with this.
Any help will be greatly appreciated.
date Price
2020-01-01 10
2020-01-02 23
2020-01-03 NA
2020-01-04 50
.
.
.
2020-01-31 67
2020-02-01 80
.
.
.
2020-11-10 100
Please note that not every month has NA values.