Return the values at the new freq, essentially a reindex. Parameters ---------- fill_value : scalar, optional Value to use for missing values, applied during upsampling (note this does not fill NaNs that already were present). Return
(self, fill_value=None)
| 1055 | |
| 1056 | @final |
| 1057 | def asfreq(self, fill_value=None): |
| 1058 | """ |
| 1059 | Return the values at the new freq, essentially a reindex. |
| 1060 | |
| 1061 | Parameters |
| 1062 | ---------- |
| 1063 | fill_value : scalar, optional |
| 1064 | Value to use for missing values, applied during upsampling (note |
| 1065 | this does not fill NaNs that already were present). |
| 1066 | |
| 1067 | Returns |
| 1068 | ------- |
| 1069 | DataFrame or Series |
| 1070 | Values at the specified freq. |
| 1071 | |
| 1072 | See Also |
| 1073 | -------- |
| 1074 | Series.asfreq: Convert TimeSeries to specified frequency. |
| 1075 | DataFrame.asfreq: Convert TimeSeries to specified frequency. |
| 1076 | |
| 1077 | Examples |
| 1078 | -------- |
| 1079 | |
| 1080 | >>> ser = pd.Series( |
| 1081 | ... [1, 2, 3, 4], |
| 1082 | ... index=pd.DatetimeIndex( |
| 1083 | ... ["2023-01-01", "2023-01-31", "2023-02-01", "2023-02-28"] |
| 1084 | ... ), |
| 1085 | ... ) |
| 1086 | >>> ser |
| 1087 | 2023-01-01 1 |
| 1088 | 2023-01-31 2 |
| 1089 | 2023-02-01 3 |
| 1090 | 2023-02-28 4 |
| 1091 | dtype: int64 |
| 1092 | >>> ser.resample("MS").asfreq() |
| 1093 | 2023-01-01 1 |
| 1094 | 2023-02-01 3 |
| 1095 | Freq: MS, dtype: int64 |
| 1096 | """ |
| 1097 | return self._upsample("asfreq", fill_value=fill_value) |
| 1098 | |
| 1099 | @final |
| 1100 | def sum( |
no test coverage detected