I need to create a Churn label (new column) that identifies clients that traded at least once a week for the past 4 weeks and then stopped trading for the next 4 weeks.
I figured I'd need something with a "for" and a "if" but I can´t come up with a way to do it.
On one hand I have a column with the week number and another column with the client ID
In the example below (image) the client 3689 would be labelled 0 and the client 5445665 would be labelled 1
I don´t know how to replicate this data on Python, sorry for uploading a image
Aucun commentaire:
Enregistrer un commentaire