get sum of column before a date python

Solutions on MaxInterview for get sum of column before a date python by the best coders in the world

showing results for - "get sum of column before a date python"
Emilia
29 Oct 2017
1dfx['colAsum'] = dfx.apply(lambda x: df.loc[(df.date >= x.StartDate) & 
2                                            (df.date <= x.EndDate), 'colA'].sum(), axis=1)
3