• Problem Statement -- A Newspaper Publishing Company (NPC) is facing increasing churn rates since years. This evolution has been jumpstarted by the rise of news- websites, and has continued at an accelerating rate due to the popularity of tablet computers and (social) news- aggregator applications. Hence the NPC requires a predictive retention (or churn) model in order to predict which customers will not renew their newspaper subscriptions. Customers are not allowed to cancel their subscriptions; hence a customer is defined as a churner if he or she does not renew the subscription once the current

    subscriptions end.

Now there are different tables in text format that I merged and then processed the data by removing null values and adding dummy variables

this is how my processed data info

Then I sorted my data by CustomerId and End date like this

enter image description here

Now I want to know the code to make a Churn column that gives the output 1 if a customer with a particular customer ID subscribes again (The 'CustomerID' is repeated in the next row) and gives 0 if the subscription ends after that particular row.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.