Esempio n. 1
0
def computeEducation(subFolder, statData) :
    values = ParseInput.extractAnswers(statData, [15])
    eduValues = []
    for v in values :
        v = v.replace('{','').replace('}','')
        eduList = v.split('=')
        for e in eduList :
            if len(e) > 1 :
                eduValues.append(e)

    keys = [str(i+16) for i in range(7)]
    eduStat = [eduValues.count(key) for key in keys]
    print 'Education values:', eduValues, eduStat
    BuildTexts.addMacrosList(subFolder, 'numEdu', eduStat)
Esempio n. 2
0
def compute21b(subFolder, statData): # by age - q14
    print '\nComputing values for slide 2.1.2.'
    values = ParseInput.extractAnswers(statData, [14, 38,39])
    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 ]

    BuildTexts.addMacrosList(subFolder, 'valBAByesNum', yesNum)
    BuildTexts.addMacrosList(subFolder, 'valBABnoNum', noNum)

    BuildCharts.YesNoPieSVG(subFolder, 'pie212a.svg', yesNum[0], noNum[0])
    BuildCharts.YesNoPieSVG(subFolder, 'pie212b.svg', yesNum[1], noNum[1])
    BuildCharts.YesNoPieSVG(subFolder, 'pie212c.svg', yesNum[2], noNum[2])
    BuildCharts.YesNoPieSVG(subFolder, 'pie212d.svg', yesNum[3], noNum[3])
Esempio n. 3
0
def compute22d(subFolder, statData): # by question
    print '\nComputing values for slide 2.2.4.'
    values = ParseInput.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 ]

    BuildTexts.addMacrosList(subFolder, 'valBBDyesNum', yesNum)
    BuildTexts.addMacrosList(subFolder, 'valBBDnoNum', noNum)

    BuildCharts.YesNoPieSVG(subFolder, 'pie224a.svg', yesNum[0], noNum[0])
    BuildCharts.YesNoPieSVG(subFolder, 'pie224b.svg', yesNum[1], noNum[1])
    BuildCharts.YesNoPieSVG(subFolder, 'pie224c.svg', yesNum[2], noNum[2])
    BuildCharts.YesNoPieSVG(subFolder, 'pie224d.svg', yesNum[3], noNum[3])
Esempio n. 4
0
def compute22b(subFolder, statData): # by age
    print '\nComputing values for slide 2.2.2.'
    values = ParseInput.extractAnswers(statData, [14, 28,29,46,47])
    values = StatValues.joinListsByAge(values)

    yesNum = [ val.count('83') + val.count('84') for val in values ]
    noNum = [ val.count('85') + val.count('86') for val in values ]

    BuildTexts.addMacrosList(subFolder, 'valBBByesNum', yesNum)
    BuildTexts.addMacrosList(subFolder, 'valBBBnoNum', noNum)

    BuildCharts.YesNoPieSVG(subFolder, 'pie222a.svg', yesNum[0], noNum[0])
    BuildCharts.YesNoPieSVG(subFolder, 'pie222b.svg', yesNum[1], noNum[1])
    BuildCharts.YesNoPieSVG(subFolder, 'pie222c.svg', yesNum[2], noNum[2])
    BuildCharts.YesNoPieSVG(subFolder, 'pie222d.svg', yesNum[3], noNum[3])
Esempio n. 5
0
def compute21d(subFolder, statData): # by question
    print '\nComputing values for slide 2.1.4.'
    values = ParseInput.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 ]

    BuildTexts.addMacrosList(subFolder, 'valBADyesNum', yesNum)
    BuildTexts.addMacrosList(subFolder, 'valBADnoNum', noNum)

    BuildCharts.YesNoPieSVG(subFolder, 'pie214a.svg', yesNum[0], noNum[0])
    BuildCharts.YesNoPieSVG(subFolder, 'pie214b.svg', yesNum[1], noNum[1])
    BuildCharts.YesNoPieSVG(subFolder, 'pie214c.svg', yesNum[2], noNum[2])
    BuildCharts.YesNoPieSVG(subFolder, 'pie214d.svg', yesNum[3], noNum[3])
    BuildCharts.YesNoPieSVG(subFolder, 'pie214e.svg', yesNum[4], noNum[4])
Esempio n. 6
0
def compute21c(subFolder, statData): # by category - q19
    print '\nComputing values for slide 2.1.3.'
    values = ParseInput.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 ]

    BuildTexts.addMacrosList(subFolder, 'valBACyesNum', yesNum)
    BuildTexts.addMacrosList(subFolder, 'valBACnoNum', noNum)

    BuildCharts.YesNoPieSVG(subFolder, 'pie213a.svg', yesNum[0], noNum[0])
    BuildCharts.YesNoPieSVG(subFolder, 'pie213b.svg', yesNum[1], noNum[1])
    BuildCharts.YesNoPieSVG(subFolder, 'pie213c.svg', yesNum[2], noNum[2])
    BuildCharts.YesNoPieSVG(subFolder, 'pie213d.svg', yesNum[3], noNum[3])
    BuildCharts.YesNoPieSVG(subFolder, 'pie213e.svg', yesNum[4], noNum[4])
Esempio n. 7
0
def compute22c(subFolder, statData): # by category - q19
    print '\nComputing values for slide 2.2.3.'
    values = ParseInput.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 ]

    BuildTexts.addMacrosList(subFolder, 'valBBCyesNum', yesNum)
    BuildTexts.addMacrosList(subFolder, 'valBBCnoNum', noNum)

    BuildCharts.YesNoPieSVG(subFolder, 'pie223a.svg', yesNum[0], noNum[0])
    BuildCharts.YesNoPieSVG(subFolder, 'pie223b.svg', yesNum[1], noNum[1])
    BuildCharts.YesNoPieSVG(subFolder, 'pie223c.svg', yesNum[2], noNum[2])
    BuildCharts.YesNoPieSVG(subFolder, 'pie223d.svg', yesNum[3], noNum[3])
    BuildCharts.YesNoPieSVG(subFolder, 'pie223e.svg', yesNum[4], noNum[4])
Esempio n. 8
0
def computeWorkHereYears(subFolder, statData):
    values = ParseInput.extractAnswers(statData, [17])
    years = map(StatValues.toNumber, values)
    print '\nExperience:', values, years
    [expA, expB, expC, expD] = [0,0,0,0]
    for y in years :
        if y<0 :
            expA = expA
        elif y < 5 :
            expA += 1
        elif y < 11 :
            expB += 1
        elif y < 21 :
            expC += 1
        elif y>=21 and y<100:
            expD += 1 
    res = [expA, expB, expC, expD]
    BuildTexts.addMacrosList(subFolder, 'numExpHere', res)
Esempio n. 9
0
def computeTeachCat(subFolder, statData) :
    values = ParseInput.extractAnswers(statData, [19])
    keys = [str(i+55) for i in range(5)]
    stat = [values.count(key) for key in keys]
    print '\nTeacher categories:', values, stat
    BuildTexts.addMacrosList(subFolder, 'numTechCat', stat)