def grouped_weighted_avg(values, weights, by):
    return (values * weights).groupby(by).sum() / weights.groupby(by).sum()
grouped_weighted_avg(values=df.wt, weights=df.value, by=df.index)
Calculate weighted average using a pandas/dataframe