本文整理匯總了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