So I have a set of 50 dates I have specified 7 here for example
df["CreatedDate"] = pd.DataFrame('09-08-16 0:00','22-08-16 0:00','23-08-16 0:00',28-08-16 0:00,'29-08-16 0:00','30-08-16 0:00','31-08-16 0:00')
df["CreatedDate"] = pd.to_datetime(df4.CreatedDate)
df4["DAY"] = df4.CreatedDate.dt.day
How to find the continuous days which form a streak range [1-3],[4-7],[8-15],[>=16]
Streak Count
1-3 3 #(9),(22,23) are in range [1-3]
4-7 1 #(28,29,30,31) are in range [4-7]
8-15 0
>=16 0
let's just say the product (pen) has been launched 2 yrs back we are taking the dataset for last 10 months from today and from what I want to find is that if people are buying that pen continuously for 1 or 2 or 3 days and if yes place the count [1-3] and if they are buying it continuously for 4 or 5 or 6 or 7 days we place the count in [4- 7] and so on for other ranges
I dont know which condition to specify to match the criteria