Skip to content

Commit

Permalink
More results
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmahom5 committed Jun 28, 2023
1 parent 70e0d52 commit e87a20a
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/mridle/utilities/intervention.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,23 @@ def send_results():

# remove duplicates (some appts were included in both monday and thursday's intervention/control group)
intervention_df = intervention_df.sort_values('file').groupby(['FillerOrderNo', 'start_time']).last().reset_index()
intervention_df['reached'] = intervention_df['feedback'].map({
'control': 'control',
'comes': 'reached',
'not reached': 'not reached',
'to be rescheduled': 'reached'
})
intervention_df['reached_2'] = intervention_df['feedback'].map({
'control': 'control',
'comes': 'reached',
'not reached': 'control',
'to be rescheduled': 'reached'
})

r_1 = intervention_df.groupby('control').agg({'NoShow': ['count', 'sum', 'mean']}).reset_index()
r_2 = intervention_df.groupby(['control', 'feedback']).agg({'NoShow': ['count', 'sum', 'mean']}).reset_index()
r_3 = intervention_df.groupby(['reached']).agg({'NoShow': ['count', 'sum', 'mean']})
r_4 = intervention_df.groupby(['reached_2']).agg({'NoShow': ['count', 'sum', 'mean']})

# Read the configuration file
config = configparser.ConfigParser()
Expand Down Expand Up @@ -183,7 +197,11 @@ def send_results():
{}
{}
""".format(r_1.to_html(), r_2.to_html())
{}
{}
""".format(r_1.to_html(), r_2.to_html(), r_3.to_html(), r_4.to_html())
msg.attach(MIMEText(body, 'html'))

# send the email
Expand Down

0 comments on commit e87a20a

Please sign in to comment.