I would like to fill one specific column, the "id" column with the "id" in that group, and forward fill the other columns with 0 after applying a groupwise reindex.
my current version with filling all missing values with 0 looks like this:
def reindex_by_date(df):
bd = pd.bdate_range('2000-12-18', '2020-12-31')
return df.reindex(bd)
test.groupby('id').apply(reindex_by_date).reset_index(0, drop=True)
but I cant make it work to fill the "id" with id"s within that group
I found a solution. Posting so maybe it will help someone else: