本文整理汇总了Python中pymodule.PassingData.symbol2MAJ_MIN方法的典型用法代码示例。如果您正苦于以下问题:Python PassingData.symbol2MAJ_MIN方法的具体用法?Python PassingData.symbol2MAJ_MIN怎么用?Python PassingData.symbol2MAJ_MIN使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymodule.PassingData
的用法示例。
在下文中一共展示了PassingData.symbol2MAJ_MIN方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_symbol2MAJ_MIN
# 需要导入模块: from pymodule import PassingData [as 别名]
# 或者: from pymodule.PassingData import symbol2MAJ_MIN [as 别名]
def get_symbol2MAJ_MIN(self, symbol2counts):
#construct a dictionary to map input symbols to MAJ, MIN or '?'
symbol2MAJ_MIN = {self.input_NA_char:'?'} #'NA' is always '?'
symbols = symbol2counts.keys()
if len(symbols) == 0:
major = ''
minor = ''
elif len(symbols) == 1:
symbol2MAJ_MIN[symbols[0]] = MAJ
major = symbols[0]
minor = ''
elif len(symbols) ==2:
major, minor = symbols
if symbol2counts[major]<symbol2counts[minor]:
minor, major = symbols #reverse them
symbol2MAJ_MIN[major] = MAJ
symbol2MAJ_MIN[minor] = MIN
elif len(symbols)>2:
major, minor = None, None
symbol2MAJ_MIN = 3
passingdata = PassingData()
passingdata.symbol2MAJ_MIN = symbol2MAJ_MIN
passingdata.major = major
passingdata.minor = minor
return passingdata