Skip to content

Instantly share code, notes, and snippets.

@MoGaber
Created December 14, 2020 05:05
Show Gist options
  • Save MoGaber/c6bf4a4de5a2e8469e59f644ad25611c to your computer and use it in GitHub Desktop.
Save MoGaber/c6bf4a4de5a2e8469e59f644ad25611c to your computer and use it in GitHub Desktop.
get_answe_ratio
#get the answers to email ratio (#answers/#emails sent) for each professional
prof_emls = immediate_emails["emails_recipient_id"].value_counts().reset_index().rename(columns = {"index":"professional_id", "emails_recipient_id":"num_emails"})
professionals_dataset = pd.merge(professionals_dataset,prof_emls,how='left', on=["professional_id" ])
professionals_dataset["answrs_emails_ratio"] = professionals_dataset["number_q_answered"] / professionals_dataset["num_emails"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment