Created
August 14, 2020 13:22
-
-
Save kurasaiteja/ac13b879e1a0567b992eeecc84ddfb5b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
best_churn = pd.DataFrame(last_transaction) | |
#Convert the cutoff_day to date time format | |
cutoff_day = pd.to_datetime("01/05/20") | |
def d(date): | |
if date < cutoff_day: | |
return 1 | |
else: | |
return 0 | |
# Creating a boolean column to denote churn status | |
best_churn["churned"] = best_churn["transaction_date"].apply(d) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment