leo_kor

Untitled

Feb 23rd, 2021
599
17 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. df_users = df_users.query('month >= reg_month')
  2.  
  3. # создадим столбец churn_month - месяц расторжения контракта с оператором
  4. df_users['churn_month'] = df_users['churn_date'].values.astype('datetime64[M]')
  5.  
  6. df_users = df_users.query(('churn_month.isnull()') or ('churn_month >= month'))
RAW Paste Data