79303833

Date: 2024-12-23 17:49:20
Score: 1
Natty:
Report link

The documentation mentions that "filling while reindexing does not look at dataframe values, but only compares the original and desired indexes." Because 2023-12-31 is missing from the original index, the function will frontfill from the last available index (2023-12-29) regardless of whether that value is present or NaN.

You can get the function to frontfill the 2023-12-28 value by executing p.drop(pd.Timestamp(2023,12,29)) rather than simply setting the 2023-12-19 value to be NaN.

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: cpage