I have a dataset:
Line Style No Loading date
G01 DDS23-00648-1101(BR) 05/08/2024
G01 RG322F2633 09/08/2024
G01 RG322F2633 17/08/2024
G01 RG322F2633 24/08/2024
raw data
I want to expand the loading date like this:
Line Style No Loading date
G01 DDS23-00648-1101(BR) 05/08/2024
G01 DDS23-00648-1101(BR) 06/08/2024
G01 DDS23-00648-1101(BR) 07/08/2024
G01 DDS23-00648-1101(BR) 08/08/2024
G01 RG322F2633 09/08/2024
G01 RG322F2633 10/08/2024
G01 RG322F2633 11/08/2024
G01 RG322F2633 12/08/2024
G01 RG322F2633 13/08/2024
G01 RG322F2633 14/08/2024
G01 RG322F2633 15/08/2024
G01 RG322F2633 16/08/2024
G01 RG322F2633 17/08/2024
G01 RG322F2633 18/08/2024
G01 RG322F2633 19/08/2024
G01 RG322F2633 20/08/2024
G01 RG322F2633 21/08/2024
G01 RG322F2633 22/08/2024
G01 RG322F2633 23/08/2024
G01 RG322F2633 24/08/2024
expected result
I tried using this but it did not work. please help me!
df1.set_index(‘Loading_date’).groupby([‘Line’, ‘Style No’]).resample(‘1D’).ffill().reset_index()
expected result
Đức Hoàng Nguyễn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.