I'm creating a payments_summary database where I have a client ID in each row, and a month in each column.
The origin database has as columns [client_ID, date, amount]
(a row for each payment received).
And I have another database where I have
using Pandas, I can group by month easily with pandas, and resample function by month, and I understand I could loop over the database so that each row is processed with a different date, but since my db is somehow big, I would rather use a vectorial function.
This, groups by month, but I want to group by month with different cut off date.
I tried
df.groupby(['colA']).resample('M').sum()
So, if client A cut off date is each 4th, I can have a matrix where each column has the sum of payments from to the 4th of May to the 4th of June, and like that for each month, not from the 1st to the last day to the month.