Skip to content

Instantly share code, notes, and snippets.

@MattMcMurray
Last active November 10, 2017 18:12
Show Gist options
  • Save MattMcMurray/aa14170cf1be77ffb4633b6c9dbe0196 to your computer and use it in GitHub Desktop.
Save MattMcMurray/aa14170cf1be77ffb4633b6c9dbe0196 to your computer and use it in GitHub Desktop.
time_deltas = appt_data['AppointmentDay'] - appt_data['ScheduledDay']
appt_data['WaitingTime'] = time_deltas.copy()
appt_data['WaitingTime'] = appt_data['WaitingTime'].dt.days
# Interestingly, about 1/3 of appointments were booked AFTER they happened...
appt_data['WaitingTime'].where(
appt_data['WaitingTime'] < pd.Timedelta(0)).count() / appt_data['WaitingTime'].count()
# 0.34894641128412063
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment