I am stuck at a problem and am thinking how to come out of it. I want to write a code in python with dataframe as below:
data = {'Id':['a', 'a', 'b', 'b', 'c', 'c'], 'value':['Active', 'Notactive', 'Active', 'Superactive', 'Notactive', 'Superactive'], 'date':['8-09-2019','15-09-2019','8-09-2019','15-09-2019','8-09-2019','15-09-2019']} df = pd.DataFrame(data) I want to reach to the result where i count the number of users who did transition in the 7 day difference: Active to notactive: 1 Active to superactive: 1 Not active to superactive: 1 Active to Active: 0
Any help on how to proceed would be appreciated on python 3.7
Thanks