- 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
Now there are different tables in text format that I merged and then processed the data by removing null values and adding dummy variables
Then I sorted my data by CustomerId and End date like this
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.