def get_mh_appt_dates(self, people):
""" Get the dates of mental health appointments for people labeled
correctly by the model.
:param people: list of ids to search for
:type people: tuple
:returns: mental health appointment data
:rtype: pandas DataFrame
"""
mh_services_query = """
select
dedupe_id,
svc_date
from
clean.jocomentalhealthservices
where
svc_date < '{0}' and
dedupe_id in {1}
""".format(self.features['labeling_end_date'].unique()[0], people)
return(pd.read_sql(mh_services_query, self.engine).set_index('dedupe_id'))
评论列表
文章目录