def changeParameter(n_clicks, input1, input2, input3, input4): global tuningSetAgeRate, tuningSetRetireRate, dfResultData, dfTotalDoctor, dfNewDoctor, dfDeadDoctor, dfRetireDoctor, dfThousandPerDoctor for i in range(22): npBasicPopulation[i] = np.array([input1, input2, input3, input4]) dfResultData = idoct.makeResultData( npBasicPopulation, [tuningSetAgeRate, tuningSetRetireRate]) dfTotalDoctor = [ dfResultData[0], dfResultData[1], dfResultData[0] + dfResultData[1] ] # 의사수 dfNewDoctor = [ dfResultData[2], dfResultData[3], dfResultData[2] + dfResultData[3] ] # 신규의사수 dfDeadDoctor = [ dfResultData[4], dfResultData[5], dfResultData[4] + dfResultData[5] ] # 사망자수 dfRetireDoctor = [ dfResultData[6], dfResultData[7], dfResultData[6] + dfResultData[7] ] # 은퇴자수 dfThousandPerDoctor = idoct.makeThousandPerDoctor( dfTotalDoctor, idoct.npPopulation) # 1000명당 의사수 return u''' 의사고시 합격자 중 의대졸업인원 {}명, 의전원졸업 {}명, 의대졸업인원 남성비율 {}%, 의대졸업인원 여성비율 {}% '''.format(input1, input2, input3 * 100, input4 * 100)
def changeParameter(n_clicks, input1, input2, input3, input4): global tuningSetAgeRate, tuningSetRetireRate, dfResultData, dfTotalDoctor, dfNewDoctor, dfDeadDoctor, dfRetireDoctor, dfThousandPerDoctor, dfPopulation, npVisitNumYear, npVisitNumYearOECD valueSet = [input1,input2,input3,input4] for i in range(21): npBasicPopulation[i] = np.array([input1,input2,input3,input4]) dfResultData = idoct.makeResultData(npBasicPopulation,[tuningSetAgeRate,tuningSetRetireRate]) dfTotalDoctor = [dfResultData[0],dfResultData[1],dfResultData[0]+dfResultData[1]] # 의사수 dfNewDoctor = [dfResultData[2],dfResultData[3],dfResultData[2]+dfResultData[3]] # 신규의사수 dfDeadDoctor = [dfResultData[4],dfResultData[5],dfResultData[4]+dfResultData[5]] # 사망자수 dfRetireDoctor = [dfResultData[6],dfResultData[7],dfResultData[6]+dfResultData[7]] # 은퇴자수 dfThousandPerDoctor = idoct.makeThousandPerDoctor(dfTotalDoctor, idoct.npPopulation) # 1000명당 의사수 npDoctorNum = np.around(np.array(dfThousandPerDoctor.iloc[60:]).T[0],2) npVisitDay = np.array(idoct.dfVisitDays['국내내원일수']) npVisitNumYear = (npVisitDay*1000)/npDoctorNum # 국내의사 1인당 외래진료수 npVisitNumYearOECD = np.array(idoct.dfVisitDays['OECD1인당연간외래진료수']) dfVisitNumYear = pd.DataFrame(np.array([npVisitNumYear,npVisitNumYearOECD]).T)
showlegend=True, yaxis=dict(range=[0,80]) ) return fig external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css'] npBasicPopulation = np.zeros([22,4]) for i in range(22): npBasicPopulation[i] = np.array([3000,50,0.6,0.6]) tuningSetAgeRate = [[0.8, 0.1, 0.1, 0.25, 0.1, 0.15],[26,26,28,28,27,27],[40, 40, 40, 40, 40, 40]] tuningSetRetireRate = [[1.1, 1.05],[30, 30],[1.0, 1.0]] dfResultData = idoct.makeResultData(npBasicPopulation,[tuningSetAgeRate,tuningSetRetireRate]) dfTotalDoctor = [dfResultData[0],dfResultData[1],dfResultData[0]+dfResultData[1]] # 의사수 dfNewDoctor = [dfResultData[2],dfResultData[3],dfResultData[2]+dfResultData[3]] # 신규의사수 dfDeadDoctor = [dfResultData[4],dfResultData[5],dfResultData[4]+dfResultData[5]] # 사망자수 dfRetireDoctor = [dfResultData[6],dfResultData[7],dfResultData[6]+dfResultData[7]] # 은퇴자수 dfThousandPerDoctor = idoct.makeThousandPerDoctor(dfTotalDoctor, idoct.npPopulation) # 1000명당 의사수 BS = "https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" app = dash.Dash(__name__, external_stylesheets=[BS]) colors = { 'background': '#F2F2F2', 'text': '#151515'