def compute74(subFolder, statData): # by question print '\nComputing values for slide 7.4.' values = StatValues.extractAnswers(statData, [56,57]) values = StatValues.joinListsByQuestion(values) yesNum = [ val.count('87') + val.count('88') for val in values ] noNum = [ val.count('89') + val.count('90') for val in values ] BuildTex.addMacros(subFolder, 'valGDyesNumA', str(yesNum[0])) BuildTex.addMacros(subFolder, 'valGDyesNumB', str(yesNum[1])) BuildTex.addMacros(subFolder, 'valGDnoNumA', str(noNum[0])) BuildTex.addMacros(subFolder, 'valGDnoNumB', str(noNum[1])) BuildCharts.YesNoPie(subFolder + '\\pie74a.png', yesNum[0], noNum[0]) BuildCharts.YesNoPie(subFolder + '\\pie74b.png', yesNum[1], noNum[1])
def compute32d(subFolder, statData): # by question print '\nComputing values for slide 3.2.4.' values = StatValues.extractAnswers(statData, [40, 41, 42]) values = StatValues.joinListsByQuestion(values) yesNum = [val.count('99') + val.count('100') for val in values] noNum = [val.count('101') + val.count('102') for val in values] BuildTex.addMacros(subFolder, 'valCBDyesNumA', str(yesNum[0])) BuildTex.addMacros(subFolder, 'valCBDyesNumB', str(yesNum[1])) BuildTex.addMacros(subFolder, 'valCBDyesNumC', str(yesNum[2])) BuildTex.addMacros(subFolder, 'valCBDnoNumA', str(noNum[0])) BuildTex.addMacros(subFolder, 'valCBDnoNumB', str(noNum[1])) BuildTex.addMacros(subFolder, 'valCBDnoNumC', str(noNum[2])) BuildCharts.YesNoPie(subFolder + '\\pie324a.png', yesNum[0], noNum[0]) BuildCharts.YesNoPie(subFolder + '\\pie324b.png', yesNum[1], noNum[1]) BuildCharts.YesNoPie(subFolder + '\\pie324c.png', yesNum[2], noNum[2])
def compute22d(subFolder, statData): # by question print '\nComputing values for slide 2.2.4.' values = StatValues.extractAnswers(statData, [28, 29, 46, 47]) values = StatValues.joinListsByQuestion(values) yesNum = [val.count('83') + val.count('84') for val in values] noNum = [val.count('85') + val.count('86') for val in values] BuildTex.addMacros(subFolder, 'valBBDyesNumA', str(yesNum[0])) BuildTex.addMacros(subFolder, 'valBBDyesNumB', str(yesNum[1])) BuildTex.addMacros(subFolder, 'valBBDyesNumC', str(yesNum[2])) BuildTex.addMacros(subFolder, 'valBBDyesNumD', str(yesNum[3])) BuildTex.addMacros(subFolder, 'valBBDnoNumA', str(noNum[0])) BuildTex.addMacros(subFolder, 'valBBDnoNumB', str(noNum[1])) BuildTex.addMacros(subFolder, 'valBBDnoNumC', str(noNum[2])) BuildTex.addMacros(subFolder, 'valBBDnoNumD', str(noNum[3])) BuildCharts.YesNoPie(subFolder + '\\pie224a.png', yesNum[0], noNum[0]) BuildCharts.YesNoPie(subFolder + '\\pie224b.png', yesNum[1], noNum[1]) BuildCharts.YesNoPie(subFolder + '\\pie224c.png', yesNum[2], noNum[2]) BuildCharts.YesNoPie(subFolder + '\\pie224d.png', yesNum[3], noNum[3])
def compute72(subFolder, statData): # by age - q14 print '\nComputing values for slide 7.2.' values = StatValues.extractAnswers(statData, [14, 56,57]) values = StatValues.joinListsByAge(values) yesNum = [ val.count('87') + val.count('88') for val in values ] noNum = [ val.count('89') + val.count('90') for val in values ] BuildTex.addMacros(subFolder, 'valGByesNumA', str(yesNum[0])) BuildTex.addMacros(subFolder, 'valGByesNumB', str(yesNum[1])) BuildTex.addMacros(subFolder, 'valGByesNumC', str(yesNum[2])) BuildTex.addMacros(subFolder, 'valGByesNumD', str(yesNum[3])) BuildTex.addMacros(subFolder, 'valGBnoNumA', str(noNum[0])) BuildTex.addMacros(subFolder, 'valGBnoNumB', str(noNum[1])) BuildTex.addMacros(subFolder, 'valGBnoNumC', str(noNum[2])) BuildTex.addMacros(subFolder, 'valGBnoNumD', str(noNum[3])) BuildCharts.YesNoPie(subFolder + '\\pie72a.png', yesNum[0], noNum[0]) BuildCharts.YesNoPie(subFolder + '\\pie72b.png', yesNum[1], noNum[1]) BuildCharts.YesNoPie(subFolder + '\\pie72c.png', yesNum[2], noNum[2]) BuildCharts.YesNoPie(subFolder + '\\pie72d.png', yesNum[3], noNum[3])
def compute31b(subFolder, statData): # by age - q14 print '\nComputing values for slide 3.1.2.' values = StatValues.extractAnswers(statData, [14, 43]) values = StatValues.joinListsByAge(values) yesNum = [val.count('103') + val.count('104') for val in values] noNum = [val.count('105') + val.count('106') for val in values] BuildTex.addMacros(subFolder, 'valCAByesNumA', str(yesNum[0])) BuildTex.addMacros(subFolder, 'valCAByesNumB', str(yesNum[1])) BuildTex.addMacros(subFolder, 'valCAByesNumC', str(yesNum[2])) BuildTex.addMacros(subFolder, 'valCAByesNumD', str(yesNum[3])) BuildTex.addMacros(subFolder, 'valCABnoNumA', str(noNum[0])) BuildTex.addMacros(subFolder, 'valCABnoNumB', str(noNum[1])) BuildTex.addMacros(subFolder, 'valCABnoNumC', str(noNum[2])) BuildTex.addMacros(subFolder, 'valCABnoNumD', str(noNum[3])) BuildCharts.YesNoPie(subFolder + '\\pie312a.png', yesNum[0], noNum[0]) BuildCharts.YesNoPie(subFolder + '\\pie312b.png', yesNum[1], noNum[1]) BuildCharts.YesNoPie(subFolder + '\\pie312c.png', yesNum[2], noNum[2]) BuildCharts.YesNoPie(subFolder + '\\pie312d.png', yesNum[3], noNum[3])
def compute23d(subFolder, statData): # aggregate print '\nComputing values for slide 2.3.4.' values = StatValues.extractAnswers(statData, [30]) yesNum = values.count('83') + values.count('84') noNum = values.count('85') + values.count('86') [yesNumP, noNumP] = StatValues.percent([yesNum, noNum]) BuildTex.addMacros(subFolder, 'valBCDyesNum', str(yesNum)) BuildTex.addMacros(subFolder, 'valBCDnoNum', str(noNum)) BuildTex.addMacros(subFolder, 'valBCDyesNumP', str(yesNumP)) BuildTex.addMacros(subFolder, 'valBCDnoNumP', str(noNumP)) BuildCharts.YesNoPie(subFolder + '\\pie234.png', yesNumP, noNumP)
def compute23b(subFolder, statData): # aggregate print '\nComputing values for slide 2.3.2.' values = StatValues.extractAnswers(statData, [52]) yesNum = values.count('99') + values.count('100') noNum = values.count('101') + values.count('102') [yesNumP, noNumP] = StatValues.percent([yesNum, noNum]) BuildTex.addMacros(subFolder, 'valBCByesNum', str(yesNum)) BuildTex.addMacros(subFolder, 'valBCBnoNum', str(noNum)) BuildTex.addMacros(subFolder, 'valBCByesNumP', str(yesNumP)) BuildTex.addMacros(subFolder, 'valBCBnoNumP', str(noNumP)) BuildCharts.YesNoPie(subFolder + '\\pie232.png', yesNumP, noNumP)
def compute23a(subFolder, statData): # aggregate print '\nComputing values for slide 2.3.1.' values = StatValues.extractAnswers(statData, [23]) yesNum = values.count('61') noNum = values.count('62') [yesNumP, noNumP] = StatValues.percent([yesNum, noNum]) BuildTex.addMacros(subFolder, 'valBCAyesNum', str(yesNum)) BuildTex.addMacros(subFolder, 'valBCAnoNum', str(noNum)) BuildTex.addMacros(subFolder, 'valBCAyesNumP', str(yesNumP)) BuildTex.addMacros(subFolder, 'valBCAnoNumP', str(noNumP)) BuildCharts.YesNoPie(subFolder + '\\pie231.png', yesNumP, noNumP)
def compute31a(subFolder, statData): # aggregate print '\nComputing values for slide 3.1.1.' values = StatValues.extractAnswers(statData, [43]) yesNum = values.count('103') + values.count('104') noNum = values.count('105') + values.count('106') [yesNumP, noNumP] = StatValues.percent([yesNum, noNum]) BuildTex.addMacros(subFolder, 'valCAAyesNum', str(yesNum)) BuildTex.addMacros(subFolder, 'valCAAnoNum', str(noNum)) BuildTex.addMacros(subFolder, 'valCAAyesNumP', str(yesNumP)) BuildTex.addMacros(subFolder, 'valCAAnoNumP', str(noNumP)) BuildCharts.YesNoPie(subFolder + '\\pie311.png', yesNumP, noNumP)
def compute42c(subFolder, statData): # one question print '\nComputing values for slide 4.2.c.' values = StatValues.extractAnswers(statData, [54]) yesNum = values.count('87') + values.count('88') noNum = values.count('89') + values.count('90') [yesNumP, noNumP] = StatValues.percent([yesNum, noNum]) BuildTex.addMacros(subFolder, 'valDBCyesNum', str(yesNum)) BuildTex.addMacros(subFolder, 'valDBCnoNum', str(noNum)) BuildTex.addMacros(subFolder, 'valDBCyesNumP', str(yesNumP)) BuildTex.addMacros(subFolder, 'valDBCnoNumP', str(noNumP)) BuildCharts.YesNoPie(subFolder + '\\pie42_c_.png', yesNumP, noNumP)
def compute21d(subFolder, statData): # by question print '\nComputing values for slide 2.1.4.' values = StatValues.extractAnswers(statData, [35, 38, 39, 50, 55]) values = StatValues.joinListsByQuestion(values) yesNum = [val.count('87') + val.count('88') for val in values] noNum = [val.count('89') + val.count('90') for val in values] BuildTex.addMacros(subFolder, 'valBADyesNumA', str(yesNum[0])) BuildTex.addMacros(subFolder, 'valBADyesNumB', str(yesNum[1])) BuildTex.addMacros(subFolder, 'valBADyesNumC', str(yesNum[2])) BuildTex.addMacros(subFolder, 'valBADyesNumD', str(yesNum[3])) BuildTex.addMacros(subFolder, 'valBADyesNumE', str(yesNum[4])) BuildTex.addMacros(subFolder, 'valBADnoNumA', str(noNum[0])) BuildTex.addMacros(subFolder, 'valBADnoNumB', str(noNum[1])) BuildTex.addMacros(subFolder, 'valBADnoNumC', str(noNum[2])) BuildTex.addMacros(subFolder, 'valBADnoNumD', str(noNum[3])) BuildTex.addMacros(subFolder, 'valBADnoNumE', str(noNum[4])) BuildCharts.YesNoPie(subFolder + '\\pie214a.png', yesNum[0], noNum[0]) BuildCharts.YesNoPie(subFolder + '\\pie214b.png', yesNum[1], noNum[1]) BuildCharts.YesNoPie(subFolder + '\\pie214c.png', yesNum[2], noNum[2]) BuildCharts.YesNoPie(subFolder + '\\pie214d.png', yesNum[3], noNum[3]) BuildCharts.YesNoPie(subFolder + '\\pie214e.png', yesNum[4], noNum[4])
def compute21c(subFolder, statData): # by category - q19 print '\nComputing values for slide 2.1.3.' values = StatValues.extractAnswers(statData, [19, 38, 39]) values = StatValues.joinListsByCategory(values) yesNum = [val.count('87') + val.count('88') for val in values] noNum = [val.count('89') + val.count('90') for val in values] BuildTex.addMacros(subFolder, 'valBACyesNumA', str(yesNum[0])) BuildTex.addMacros(subFolder, 'valBACyesNumB', str(yesNum[1])) BuildTex.addMacros(subFolder, 'valBACyesNumC', str(yesNum[2])) BuildTex.addMacros(subFolder, 'valBACyesNumD', str(yesNum[3])) BuildTex.addMacros(subFolder, 'valBACyesNumE', str(yesNum[4])) BuildTex.addMacros(subFolder, 'valBACnoNumA', str(noNum[0])) BuildTex.addMacros(subFolder, 'valBACnoNumB', str(noNum[1])) BuildTex.addMacros(subFolder, 'valBACnoNumC', str(noNum[2])) BuildTex.addMacros(subFolder, 'valBACnoNumD', str(noNum[3])) BuildTex.addMacros(subFolder, 'valBACnoNumE', str(noNum[4])) BuildCharts.YesNoPie(subFolder + '\\pie213a.png', yesNum[0], noNum[0]) BuildCharts.YesNoPie(subFolder + '\\pie213b.png', yesNum[1], noNum[1]) BuildCharts.YesNoPie(subFolder + '\\pie213c.png', yesNum[2], noNum[2]) BuildCharts.YesNoPie(subFolder + '\\pie213d.png', yesNum[3], noNum[3]) BuildCharts.YesNoPie(subFolder + '\\pie213e.png', yesNum[4], noNum[4])
def compute21a(subFolder, statData): # aggregate print '\nComputing values for slide 2.1.1.' values = StatValues.extractAnswers(statData, [38, 39]) values = StatValues.joinLists(values) yesNum = values.count('87') + values.count('88') noNum = values.count('89') + values.count('90') [yesNumP, noNumP] = StatValues.percent([yesNum, noNum]) BuildTex.addMacros(subFolder, 'valBAAyesNum', str(yesNum)) BuildTex.addMacros(subFolder, 'valBAAnoNum', str(noNum)) BuildTex.addMacros(subFolder, 'valBAAyesNumP', str(yesNumP)) BuildTex.addMacros(subFolder, 'valBAAnoNumP', str(noNumP)) BuildCharts.YesNoPie(subFolder + '\\pie211.png', yesNumP, noNumP)
def compute22c(subFolder, statData): # by category - q19 print '\nComputing values for slide 2.2.3.' values = StatValues.extractAnswers(statData, [19, 28, 29, 46, 47]) values = StatValues.joinListsByCategory(values) yesNum = [val.count('83') + val.count('84') for val in values] noNum = [val.count('85') + val.count('86') for val in values] BuildTex.addMacros(subFolder, 'valBBCyesNumA', str(yesNum[0])) BuildTex.addMacros(subFolder, 'valBBCyesNumB', str(yesNum[1])) BuildTex.addMacros(subFolder, 'valBBCyesNumC', str(yesNum[2])) BuildTex.addMacros(subFolder, 'valBBCyesNumD', str(yesNum[3])) BuildTex.addMacros(subFolder, 'valBBCyesNumE', str(yesNum[4])) BuildTex.addMacros(subFolder, 'valBBCnoNumA', str(noNum[0])) BuildTex.addMacros(subFolder, 'valBBCnoNumB', str(noNum[1])) BuildTex.addMacros(subFolder, 'valBBCnoNumC', str(noNum[2])) BuildTex.addMacros(subFolder, 'valBBCnoNumD', str(noNum[3])) BuildTex.addMacros(subFolder, 'valBBCnoNumE', str(noNum[4])) BuildCharts.YesNoPie(subFolder + '\\pie223a.png', yesNum[0], noNum[0]) BuildCharts.YesNoPie(subFolder + '\\pie223b.png', yesNum[1], noNum[1]) BuildCharts.YesNoPie(subFolder + '\\pie223c.png', yesNum[2], noNum[2]) BuildCharts.YesNoPie(subFolder + '\\pie223d.png', yesNum[3], noNum[3]) BuildCharts.YesNoPie(subFolder + '\\pie223e.png', yesNum[4], noNum[4])
def compute22a(subFolder, statData): # aggregate print '\nComputing values for slide 2.2.1.' values = StatValues.extractAnswers(statData, [28, 29, 46, 47]) values = StatValues.joinLists(values) yesNum = values.count('83') + values.count('84') noNum = values.count('85') + values.count('86') [yesNumP, noNumP] = StatValues.percent([yesNum, noNum]) BuildTex.addMacros(subFolder, 'valBBAyesNum', str(yesNum)) BuildTex.addMacros(subFolder, 'valBBAnoNum', str(noNum)) BuildTex.addMacros(subFolder, 'valBBAyesNumP', str(yesNumP)) BuildTex.addMacros(subFolder, 'valBBAnoNumP', str(noNumP)) BuildCharts.YesNoPie(subFolder + '\\pie221.png', yesNumP, noNumP)
def compute32a(subFolder, statData): # aggregate print '\nComputing values for slide 3.2.1.' values = StatValues.extractAnswers(statData, [40, 41, 42]) values = StatValues.joinLists(values) yesNum = values.count('99') + values.count('100') noNum = values.count('101') + values.count('102') [yesNumP, noNumP] = StatValues.percent([yesNum, noNum]) BuildTex.addMacros(subFolder, 'valCBAyesNum', str(yesNum)) BuildTex.addMacros(subFolder, 'valCBAnoNum', str(noNum)) BuildTex.addMacros(subFolder, 'valCBAyesNumP', str(yesNumP)) BuildTex.addMacros(subFolder, 'valCBAnoNumP', str(noNumP)) BuildCharts.YesNoPie(subFolder + '\\pie321.png', yesNumP, noNumP)