Created
December 14, 2020 05:05
-
-
Save MoGaber/c6bf4a4de5a2e8469e59f644ad25611c to your computer and use it in GitHub Desktop.
get_answe_ratio
This file contains 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
#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