本文整理汇总了Python中Main.zoom_family方法的典型用法代码示例。如果您正苦于以下问题:Python Main.zoom_family方法的具体用法?Python Main.zoom_family怎么用?Python Main.zoom_family使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Main
的用法示例。
在下文中一共展示了Main.zoom_family方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: computeCommunity
# 需要导入模块: import Main [as 别名]
# 或者: from Main import zoom_family [as 别名]
def computeCommunity():
"""
需要:
gloV.communitySummary
初始化赋值了:
gloV.communityScore
修改了:
gloV.communityOutput
"""
communityIncome = []
communityRongjilv = []
communityPrice = []
communityFamily = []
communityScoreTmp = []
paraPaySum = gloV.paraPayIncome + gloV.paraPayPrice + gloV.paraPayRongjilv
for i in range(0, len(gloV.communityData)):
tmpData = gloV.communityData[i]
# ---对4列参与计算的数据Zoom
# 人均可支配收入
if Main.is_valid(tmpData[2]) and Main.get_income(tmpData[2]) > 0:
communityIncome.append(Main.zoom_data(Main.get_income(tmpData[2]), gloV.communitySummary[5][2], gloV.communitySummary[4][2]))
else:
communityIncome.append(0)
# 容积率
if Main.is_valid(tmpData[3]):
communityRongjilv.append(Main.zoom_rongjilv(tmpData[3]))
else:
communityRongjilv.append(0)
# 均价
if Main.is_valid(tmpData[4]):
communityPrice.append(Main.zoom_data(tmpData[4], gloV.communitySummary[5][4], gloV.communitySummary[4][4]))
else:
communityPrice.append(0)
# 现有户数
if Main.is_valid(tmpData[5]):
communityFamily.append(Main.zoom_family(tmpData[5], gloV.communitySummary[5][5], gloV.communitySummary[4][5]))
else:
communityFamily.append(0)
communityScoreTmp.append(gloV.paraCommunityPay *
(gloV.paraPayIncome * communityIncome[i] +
gloV.paraPayPrice * communityPrice[i] +
gloV.paraPayRongjilv * communityRongjilv[i]) / paraPaySum +
gloV.paraCommunityFamily * communityFamily[i])
# ---计算社区评分
gloV.communityScore = []
gloV.communityOutput[0].append("Score")
communityScoreMin = min(communityScoreTmp)
communityScoreMax = max(communityScoreTmp)
for i in range(0, len(communityScoreTmp)):
gloV.communityScore.append(Main.zoom_data(communityScoreTmp[i], communityScoreMin, communityScoreMax))
gloV.communityOutput[i + 1].append(str(Main.zoom_data(communityScoreTmp[i], communityScoreMin, communityScoreMax)))