Imagine the ohlc data indexed in DateTime. I am going to resample this dataframe on every nth day of the month.
for example:
.
.
.
2020-09-24 1.0990 1.1000 1.0982 1.0991
2020-09-25 1.1018 1.1025 1.0964 1.0995
2020-09-26 1.1011 1.1020 1.1009 1.1018
.
.
.
2020-10-24 1.1045 1.1068 1.0995 1.1017
2020-10-25 1.1031 1.1074 1.1021 1.1045
2020-10-26 1.1071 1.1076 1.1012 1.1031
.
.
.
2020-11-23 1.1005 1.1075 1.0989 1.1071
2020-11-26 1.1079 1.1086 1.0992 1.1005
2020-11-27 1.1076 1.1087 1.1068 1.1079
.
.
.
2020-12-24 1.1058 1.1110 1.1054 1.1071
2020-12-25 1.1010 1.1087 1.0926 1.1058
2020-12-26 1.1049 1.1056 1.0983 1.1010
.
.
.
2021-01-24 1.1049 1.1059 1.1029 1.1048
2021-01-25 1.1025 1.1068 1.1014 1.1049
2021-01-26 1.1025 1.1028 1.1022 1.1025
what I need is :
2020-09-25 1.1018 1.1025 1.0964 1.0995
2020-10-25 1.1031 1.1074 1.1021 1.1045
2020-11-25 1.1005 1.1075 1.0989 1.1071
2020-12-25 1.1010 1.1087 1.0926 1.1058
2021-01-25 1.1025 1.1068 1.1014 1.1049
In fact, I need to resample on every 25th day of the month and if there were no data for it, it must be filled with the nearest previous data.