Black Lives Matter. Please consider donating to Black Girls Code today.

Simple Count of column for the output value

I’m trying to get a simple return count based off input value. I’m not getting errors when I run the .py file but I’m also not getting any values. Any Suggestions in my code:

import os
import glob
import pandas as pd
import numpy as np
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output

app = dash.Dash()


path = r’mydata’
extension = ‘xlsx’
files = [i for i in glob.glob(’*.{}’.format(extension))]
latest_file = max(files, key=os.path.getctime)
df = pd.DataFrame()
eeprofi = pd.read_excel(latest_file, converters={‘ORG_CODE_LEVEL_3’: str})
df = df.append(eeprofi)

def getCount(df, column1):

totCount = df[column1].AGENCY_INFO_5.count()

return html.H2(totCount)

org_options = []
for org in df[‘ORG_CODE_LEVEL_2_SHORT’].unique():
org_options.append({‘label’: str(org), ‘value’: org})

app.layout = html.Div(children=[

html.Label('Select Org:'),
dcc.Dropdown(id='org-dropdown', options=org_options, value=df['ORG_CODE_LEVEL_2_SHORT'].min()),


Output(component_id=‘container’, component_property=‘children’), [Input(component_id=‘org-dropdown’, component_property=‘value’)])
def update_table(selected_org):
filtered_org = df[df[‘ORG_CODE_LEVEL_2_SHORT’] == selected_org]
return getCount(filtered_org)

if name == ‘main’: