INNER CODE UNIT · Python

plot_locations

alteryx/open_source_demos · predict-appointment-noshow/utils.py:106

def plot_locations(fm):
    tmp = fm.groupby('neighborhood').apply(lambda df: df.tail(1))['locations.COUNT(appointments)'].sort_values().reset_index().reset_index()
    hover = HoverTool(tooltips=[
        ("Count", "@{locations.COUNT(appointments)}"),
        ("Place", "@neighborhood"),
    ])
    source = ColumnDataSource(tmp)
    p4 = figure(width=400,
                height=400,
                tools=[hover, 'box_zoom', 'reset', 'save'])
    p4.scatter('index', 'locations.COUNT(appointments)', alpha=.7, source=source, color='teal')
    p4.title.text = 'Appointments by Neighborhood'
    p4.xaxis.axis_label = 'Neighborhoods (hover to view)'
    p4.yaxis.axis_label = 'Count'
    return p4


def plot_noshow_by_loc(fm):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…