Fill missing prices with the last known price. Store the full DataFrame in result.
import pandas as pd
import numpy as np
prices = pd.DataFrame({
"day": pd.date_range("2025-01-01", periods=6),
"price": [100.0, np.nan, np.nan, 105.0, np.nan, 110.0],
})Store your final answer in a variable named result.
Run your code to see the output here.