df_wide = df_indexed.unstack().fillna(0)
df_long = df_wide.stack()
df_long['ind_var'] = df_long['ind_var'].groupby(level=0).transform(lambda x:
    x.max())
df_long['loc_var'] = df_long['loc_var'].groupby(level=1).transform(lambda x:
    x.max())
print(df_long)
Reindexing and filling NaN values in Pandas