Efficiently Recalculating Cumulative Values In An N X N Dataset Using Python And Pandas