當前位置: 首頁>>代碼示例>>Python>>正文


Python StatValues.percent方法代碼示例

本文整理匯總了Python中StatValues.percent方法的典型用法代碼示例。如果您正苦於以下問題:Python StatValues.percent方法的具體用法?Python StatValues.percent怎麽用?Python StatValues.percent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在StatValues的用法示例。


在下文中一共展示了StatValues.percent方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: compute21a

# 需要導入模塊: import StatValues [as 別名]
# 或者: from StatValues import percent [as 別名]
def compute21a(subFolder, statData): # aggregate
    print '\nComputing values for slide 2.1.1.'
    values = ParseInput.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])

    BuildTexts.addMacro(subFolder, 'valBAAyesNumP', str(yesNumP))
    BuildTexts.addMacro(subFolder, 'valBAAnoNumP', str(noNumP))

    BuildCharts.YesNoPieSVG(subFolder, 'pie211.svg', yesNumP, noNumP)
開發者ID:ryavorsky,項目名稱:Direktor4web,代碼行數:15,代碼來源:StatValues2.py

示例2: compute22a

# 需要導入模塊: import StatValues [as 別名]
# 或者: from StatValues import percent [as 別名]
def compute22a(subFolder, statData): # aggregate
    print '\nComputing values for slide 2.2.1.'
    values = ParseInput.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])

    BuildTexts.addMacro(subFolder, 'valBBAyesNumP', str(yesNumP))
    BuildTexts.addMacro(subFolder, 'valBBAnoNumP', str(noNumP))

    BuildCharts.YesNoPieSVG(subFolder, 'pie221.svg', yesNumP, noNumP)
開發者ID:ryavorsky,項目名稱:Direktor4web,代碼行數:15,代碼來源:StatValues2.py

示例3: compute42c

# 需要導入模塊: import StatValues [as 別名]
# 或者: from StatValues import percent [as 別名]
def compute42c(subFolder, statData): # one question 
    print '\nComputing values for slide 4.2.c.'
    values = ParseInput.extractAnswers(statData, [54])

    yesNum = values.count('87') + values.count('88')
    noNum = values.count('89') + values.count('90')
    [yesNumP, noNumP] = StatValues.percent([yesNum,noNum])

    BuildTexts.addMacro(subFolder, 'valDBCyesNum', str(yesNum))
    BuildTexts.addMacro(subFolder, 'valDBCnoNum', str(noNum))
    BuildTexts.addMacro(subFolder, 'valDBCyesNP', str(yesNumP))
    BuildTexts.addMacro(subFolder, 'valDBCnoNP', str(noNumP))

    BuildCharts.YesNoPieSVG(subFolder,'pie423.svg', yesNumP, noNumP)
開發者ID:ryavorsky,項目名稱:Direktor4web,代碼行數:16,代碼來源:StatValues4.py

示例4: compute31a

# 需要導入模塊: import StatValues [as 別名]
# 或者: from StatValues import percent [as 別名]
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', yesNum, noNum)
開發者ID:vlasova-evgeniya,項目名稱:RPyAppl1,代碼行數:16,代碼來源:StatValues3.py

示例5: compute23d

# 需要導入模塊: import StatValues [as 別名]
# 或者: from StatValues import percent [as 別名]
def compute23d(subFolder, statData): # aggregate
    print '\nComputing values for slide 2.3.4.'
    values = ParseInput.extractAnswers(statData, [30])

    yesNum = values.count('83') + values.count('84')
    noNum = values.count('85') + values.count('86')
    [yesNumP, noNumP] = StatValues.percent([yesNum,noNum])

    BuildTexts.addMacro(subFolder, 'valBCDyesNum', str(yesNum))
    BuildTexts.addMacro(subFolder, 'valBCDnoNum', str(noNum))
    BuildTexts.addMacro(subFolder, 'valBCDyesNP', str(yesNumP))
    BuildTexts.addMacro(subFolder, 'valBCDnoNP', str(noNumP))

    BuildCharts.YesNoPieSVG(subFolder, 'pie234.svg', yesNumP, noNumP)
開發者ID:ryavorsky,項目名稱:Direktor4web,代碼行數:16,代碼來源:StatValues2.py

示例6: compute23b

# 需要導入模塊: import StatValues [as 別名]
# 或者: from StatValues import percent [as 別名]
def compute23b(subFolder, statData): # aggregate
    print '\nComputing values for slide 2.3.2.'
    values = ParseInput.extractAnswers(statData, [52])

    yesNum = values.count('99') + values.count('100')
    noNum = values.count('101') + values.count('102')
    [yesNumP, noNumP] = StatValues.percent([yesNum,noNum])

    BuildTexts.addMacro(subFolder, 'valBCByesNum', str(yesNum))
    BuildTexts.addMacro(subFolder, 'valBCBnoNum', str(noNum))
    BuildTexts.addMacro(subFolder, 'valBCByesNP', str(yesNumP))
    BuildTexts.addMacro(subFolder, 'valBCBnoNP', str(noNumP))

    BuildCharts.YesNoPieSVG(subFolder, 'pie232.svg', yesNumP, noNumP)
開發者ID:ryavorsky,項目名稱:Direktor4web,代碼行數:16,代碼來源:StatValues2.py

示例7: compute23a

# 需要導入模塊: import StatValues [as 別名]
# 或者: from StatValues import percent [as 別名]
def compute23a(subFolder, statData): # aggregate
    print '\nComputing values for slide 2.3.1.'
    values = ParseInput.extractAnswers(statData, [23])

    yesNum = values.count('61')
    noNum = values.count('62')
    [yesNumP, noNumP] = StatValues.percent([yesNum,noNum])

    BuildTexts.addMacro(subFolder, 'valBCAyesNum', str(yesNum))
    BuildTexts.addMacro(subFolder, 'valBCAnoNum', str(noNum))
    BuildTexts.addMacro(subFolder, 'valBCAyesNP', str(yesNumP))
    BuildTexts.addMacro(subFolder, 'valBCAnoNP', str(noNumP))

    BuildCharts.YesNoPieSVG(subFolder, 'pie231.svg', yesNumP, noNumP)
開發者ID:ryavorsky,項目名稱:Direktor4web,代碼行數:16,代碼來源:StatValues2.py

示例8: compute32a

# 需要導入模塊: import StatValues [as 別名]
# 或者: from StatValues import percent [as 別名]
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', yesNum, noNum)
開發者ID:vlasova-evgeniya,項目名稱:RPyAppl1,代碼行數:17,代碼來源:StatValues3.py

示例9: compute71

# 需要導入模塊: import StatValues [as 別名]
# 或者: from StatValues import percent [as 別名]
def compute71(subFolder, statData):  # aggregate
    print "\nComputing values for slide 7.1."
    values = StatValues.extractAnswers(statData, [56, 57])
    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, "valGAyesNum", str(yesNum))
    BuildTex.addMacros(subFolder, "valGAnoNum", str(noNum))
    BuildTex.addMacros(subFolder, "valGAyesNumP", str(yesNumP))
    BuildTex.addMacros(subFolder, "valGAnoNumP", str(noNumP))

    BuildCharts.YesNoPie(subFolder + "\\pie71.png", yesNumP, noNumP)
開發者ID:ryavorsky,項目名稱:RPyAppl1,代碼行數:17,代碼來源:StatValues5.py

示例10: compute23c

# 需要導入模塊: import StatValues [as 別名]
# 或者: from StatValues import percent [as 別名]
def compute23c(subFolder, statData): # aggregate (1 question)
    print '\nComputing values for slide 2.3.3.'
    values = ParseInput.extractAnswers(statData, [53])

    ansA = values.count('120') 
    ansB = values.count('121')
    ansC = values.count('122') 
    [ansAp, ansBp, ansCp] = StatValues.percent([ansA, ansB, ansC])

    BuildTexts.addMacro(subFolder, 'valBCCansA', str(ansA))
    BuildTexts.addMacro(subFolder, 'valBCCansB', str(ansB))
    BuildTexts.addMacro(subFolder, 'valBCCansC', str(ansC))
    BuildTexts.addMacro(subFolder, 'valBCCanAp', str(ansAp))
    BuildTexts.addMacro(subFolder, 'valBCCanBp', str(ansBp))
    BuildTexts.addMacro(subFolder, 'valBCCanCp', str(ansCp))
    
    BuildCharts.Pie(subFolder, 'pie233.svg', [ansAp, ansBp, ansCp])
開發者ID:ryavorsky,項目名稱:Direktor4web,代碼行數:19,代碼來源:StatValues2.py

示例11: compute42a

# 需要導入模塊: import StatValues [as 別名]
# 或者: from StatValues import percent [as 別名]
def compute42a(subFolder, statData): # one question 
    print '\nComputing values for slide 4.2.a'
    values = ParseInput.extractAnswers(statData, [37])
    ansA = values.count('95') 
    ansB = values.count('96')
    ansC = values.count('97') 
    ansD = values.count('98')
    [ansAp, ansBp, ansCp, ansDp] = StatValues.percent([ansA, ansB, ansC, ansD])

    BuildTexts.addMacro(subFolder, 'valDBAansAv', str(ansA))
    BuildTexts.addMacro(subFolder, 'valDBAansBv', str(ansB))
    BuildTexts.addMacro(subFolder, 'valDBAansCv', str(ansC))
    BuildTexts.addMacro(subFolder, 'valDBAansDv', str(ansD))
    BuildTexts.addMacro(subFolder, 'valDBAansAp', str(ansAp))
    BuildTexts.addMacro(subFolder, 'valDBAansBp', str(ansBp))
    BuildTexts.addMacro(subFolder, 'valDBAansCp', str(ansCp))
    BuildTexts.addMacro(subFolder, 'valDBAansDp', str(ansDp))
    
    BuildCharts.Pie(subFolder,'pie421.svg', [ansAp, ansBp, ansCp, ansDp])
開發者ID:ryavorsky,項目名稱:Direktor4web,代碼行數:21,代碼來源:StatValues4.py

示例12: compute41

# 需要導入模塊: import StatValues [as 別名]
# 或者: from StatValues import percent [as 別名]
def compute41(subFolder, statData): # one question 
    print '\nComputing values for slide 4.1.'
    values = StatValues.extractAnswers(statData, [36])
    ansA = values.count('91') 
    ansB = values.count('92')
    ansC = values.count('93') 
    ansD = values.count('94')
    [ansAp, ansBp, ansCp, ansDp] = StatValues.percent([ansA, ansB, ansC, ansD])

    BuildTex.addMacros(subFolder, 'valDAansA', str(ansA))
    BuildTex.addMacros(subFolder, 'valDAansB', str(ansB))
    BuildTex.addMacros(subFolder, 'valDAansC', str(ansC))
    BuildTex.addMacros(subFolder, 'valDAansD', str(ansD))
    BuildTex.addMacros(subFolder, 'valDAansAp', str(ansAp))
    BuildTex.addMacros(subFolder, 'valDAansBp', str(ansBp))
    BuildTex.addMacros(subFolder, 'valDAansCp', str(ansCp))
    BuildTex.addMacros(subFolder, 'valDAansDp', str(ansDp))
    
    BuildCharts.Pie(subFolder + '\\pie41.png', [ansAp, ansBp, ansCp, ansDp])
開發者ID:ryavorsky,項目名稱:RPyAppl1,代碼行數:21,代碼來源:StatValues4.py

示例13: compute22e

# 需要導入模塊: import StatValues [as 別名]
# 或者: from StatValues import percent [as 別名]
def compute22e(subFolder, statData): # aggregate (1 question)
    print '\nComputing values for slide 2.2.5.'
    values = StatValues.extractAnswers(statData, [49])

    ansA = values.count('115') 
    ansB = values.count('116')
    ansC = values.count('117') 
    ansD = values.count('118')
    [ansAp, ansBp, ansCp, ansDp] = StatValues.percent([ansA, ansB, ansC, ansD])

    BuildTex.addMacros(subFolder, 'valBBEansA', str(ansA))
    BuildTex.addMacros(subFolder, 'valBBEansB', str(ansB))
    BuildTex.addMacros(subFolder, 'valBBEansC', str(ansC))
    BuildTex.addMacros(subFolder, 'valBBEansD', str(ansD))
    BuildTex.addMacros(subFolder, 'valBBEansAp', str(ansAp))
    BuildTex.addMacros(subFolder, 'valBBEansBp', str(ansBp))
    BuildTex.addMacros(subFolder, 'valBBEansCp', str(ansCp))
    BuildTex.addMacros(subFolder, 'valBBEansDp', str(ansDp))
    
    BuildCharts.Pie(subFolder + '\\pie225.png', [ansA, ansB, ansC, ansD])
開發者ID:vlasova-evgeniya,項目名稱:RPyAppl1,代碼行數:22,代碼來源:StatValues2.py

示例14: compute42b

# 需要導入模塊: import StatValues [as 別名]
# 或者: from StatValues import percent [as 別名]
def compute42b(subFolder, statData): # one question 
    print '\nComputing values for slide 4.2.b.'
    values = ParseInput.extractAnswers(statData, [45])
    ansA = values.count('107') 
    ansB = values.count('108')
    ansC = values.count('109') 
    ansD = values.count('110')
    ansE = values.count('111')
    [ansAp, ansBp, ansCp, ansDp, ansEp] = StatValues.percent([ansA, ansB, ansC, ansD, ansE])

    BuildTexts.addMacro(subFolder, 'valDBBansAv', str(ansA))
    BuildTexts.addMacro(subFolder, 'valDBBansBv', str(ansB))
    BuildTexts.addMacro(subFolder, 'valDBBansCv', str(ansC))
    BuildTexts.addMacro(subFolder, 'valDBBansDv', str(ansD))
    BuildTexts.addMacro(subFolder, 'valDBBansEv', str(ansE))
    BuildTexts.addMacro(subFolder, 'valDBBansAp', str(ansAp))
    BuildTexts.addMacro(subFolder, 'valDBBansBp', str(ansBp))
    BuildTexts.addMacro(subFolder, 'valDBBansCp', str(ansCp))
    BuildTexts.addMacro(subFolder, 'valDBBansDp', str(ansDp))
    BuildTexts.addMacro(subFolder, 'valDBBansEp', str(ansEp))
    
    BuildCharts.Pie(subFolder,'pie422.svg', [ansAp, ansBp, ansCp, ansDp, ansEp])
開發者ID:ryavorsky,項目名稱:Direktor4web,代碼行數:24,代碼來源:StatValues4.py


注:本文中的StatValues.percent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。