I would like to fill the missing data using the value from the previous trading day of the same stock. In this example, the AAPL stock should be 100.
I've tried with fillna
but I am not able to pick a specific row based on the stock.
My data:
date stock price
22/12/20 MSFT 87
22/12/20 AAPL 99
22/12/20 FCA 81
23/12/20 MSFT 90
23/12/20 AAPL 100
23/12/20 FCA 80
24/12/20 MSFT 91
24/12/20 AAPL NaN
24/12/20 FCA 78