Google Cloud Platform, Vertex AI, Machine Learning, Data Science, Hands On Tutorials.
df.groupby('user_id')['created_at'].count().to_frame("n_purchases") # Merge with dataset and filter those with more than 1 purchase df = df.merge(recurrent_customers, left_on='user_id', right_index=True, how='inner') df = df.query('n_purchases > 1') # Fill missing value df.fillna('NA',