本文整理汇总了Python中population.Population.popnames方法的典型用法代码示例。如果您正苦于以下问题:Python Population.popnames方法的具体用法?Python Population.popnames怎么用?Python Population.popnames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类population.Population
的用法示例。
在下文中一共展示了Population.popnames方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Population
# 需要导入模块: from population import Population [as 别名]
# 或者: from population.Population import popnames [as 别名]
from population import Population
# example use of GenePopData and Population
apop = Population(None)
# read and process data in GenePop file 'genepop_western_alaska_chinook_RAD.txt'
apop.fromGenePop("genepop_western_alaska_chinook_RAD.txt")
#save to pickle file
apop.toFile('alaska_chinook.pickle')
# once data are pickled, we no longer need GenePopData
# to retrieve data from the original data file
apop.fromFile('alaska_chinook.pickle')
# get fish information by population
fishies = apop.fishies() # list of all fish (and alleles) in file
fishies = apop.fishies(apop.popnames()[2]) # list of all fish (and alleles) in third population
# get alleles by population
alleles = apop.alleles() # all alleles of all populations
alleles = apop.alleles(apop.popnames()[2]) # all alleles in third population