Skip to content

Instantly share code, notes, and snippets.

@h-okay
Last active January 5, 2022 16:12
Show Gist options
  • Save h-okay/238aa51e6d4492b9528b2f1a7aed642d to your computer and use it in GitHub Desktop.
Save h-okay/238aa51e6d4492b9528b2f1a7aed642d to your computer and use it in GitHub Desktop.
add_clv
final = rfm[['rfm_segment']].merge(cltv_final, on='Customer ID') # Merging RFM
final.rename(columns={'scaled_clv': '6m_scaled_clv', 'clv': '6m_clv'},
inplace=True)
final = add_clv(final, cltv_df, 1)
final = add_clv(final, cltv_df, 12)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment