diffed = grouped.diff()
diffed.iloc[(0), :] = grouped.iloc[(0), :]
diffed['total'] = diffed.apply(lambda x: x[x > 0].sum(), axis=1)
diffed['total'].sum()
Pandas - Finding Unique Entries in Daily Census Data