10 2014 档案
摘要:KaKs_Calculatoradopts model selection and model averaging to calculate nonsynonymous (Ka) and synonymous (Ks) substitution rates, attempting to includ...
阅读全文
摘要:PAL2NAL is a program that converts a multiple sequence alignment of proteins and the corresponding DNA (or mRNA) sequences into a codon alignment.http...
阅读全文
摘要:Clustal, Multiple alignment of nucleic acid and protein sequences.official website:http://www.clustal.org/使用biopython, 有相应的接口可以直接调用clustalw.from Bio.A...
阅读全文
摘要:这里需要认真学习一下。
阅读全文
摘要:class Parent(object): def __init__(self, **kwargs): if kwargs.has_key('age'): self.__age = kwargs['age'] if kwargs.has_key...
阅读全文
摘要:主要是箱形图,平均值,中位数,方差的计算及。内容再补。
阅读全文
摘要:## Animal is-a object (yes, sort of confusing) look at the extra creditclass Animal(object): pass## ??class Dog(Animal): def __init__(self, name): #...
阅读全文
摘要:import randomfrom urllib import urlopenimport sysWORD_URL = "http://learncodethehardway.org/words.txt"WORDS = []PHRASES = { "class ###(###):": "Mak...
阅读全文
摘要:boxplotDefinition : boxplot(x, notch=False, sym='b+', vert=True, whis=1.5, positions=None, widths=None, patch_artist=False, bootstrap=None, usermedian...
阅读全文
摘要:class Song(object): def __init__(self, lyrics): self.lyrics = lyrics def sing_me_a_song(self): for line in self.lyrics: print linehappy_bda...
阅读全文
摘要:# create a mapping of state to abbreviationstates = {'Oregon': 'OR','Florida': 'FL','California': 'CA','New York': 'NY','Michigan': 'MI' }# create a b...
阅读全文
摘要:class Thing(): def test(self, hi): print 'hi'a.test('hello')以上为修改后的代码ten_things = "Apples Oranges Crows Telephone Light Sugar"print "Wait th...
阅读全文
摘要:anddelfromnotwhileaselifglobalorwithassert #http://stackoverflow.com/questions/5142418/what-is-the-use-of-assert-in-pythonThe assert statement/functio...
阅读全文
摘要:from sys import exitdef gold_room(): print "This room is full of gold. How much do you take?" next = raw_input("> ") if "0" in next or "1" in...
阅读全文
摘要:自己的几个list常用用法。mylist = [i for i in range(10)]mylist.pop(-1)mylist.append(9)mylist_1 = [i for i in range(10,20)]mylist_2 = zip(mylist, mylist_1)mylist....
阅读全文
摘要:while用起来不如for安全。i = 0numbers = []while i < 6: print "At the top i is %d" % i numbers.append(i) i = i + 1 print "Numbers now: ", numbers print "At ...
阅读全文
摘要:the_count = [1, 2, 3, 4, 5]fruits = ['apples', 'oranges', 'pears', 'apricots']change = [1, 'pennies', 2, 'dimes', 3, 'quarters']# this first kind of f...
阅读全文
摘要:# -*- coding: utf-8 -*-"""Created on Fri Oct 24 19:32:45 2014@author: dell"""# -*- coding: utf-8 -*-"""Created on Fri Oct 17 09:14:25 2014generate fig...
阅读全文
摘要:print "You enter a dark room with two doors. Do you go through door #1 or door #2?"door = raw_input("> ")if door == "1": print "There's a giant bear ...
阅读全文
摘要:if __name__ == '__main__': a = 100 if a > 90: print "90" elif a > 80: print '80' elif a > 70...
阅读全文
摘要:people = 20cats = 30dogs = 15if people cats: print "Not many cats! The world is saved!"if people dogs: print "The world is dry!"dogs += 5if people...
阅读全文
摘要:def break_words(stuff): """This function will break up words for us.""" words = stuff.split(' ') return wordsdef sort_words(words): """Sorts t...
阅读全文
摘要:print "Let's practice everything." print 'You\'d need to know \'bout escapes with \\ that do \n newlines and \t tabs.'poem = """\tThe lovely worldwith...
阅读全文
摘要:In cases like this, where the independent variable does not have an intrinsic ordering, it isoften a good idea to sort entries by the dependent variab...
阅读全文
摘要:def add(a, b):print "ADDING %d + %d" % (a, b)return a + bdef subtract(a, b):print "SUBTRACTING %d - %d" % (a, b) return a - bdef multiply(a, b): ...
阅读全文
摘要:from sys import argvscript, input_file = argvdef print_all(f): print f.read() def rewind(f): f.seek(0)def print_a_line(line_count, f): pri...
阅读全文
摘要:def cheese_and_crackers(cheese_count, boxes_of_crackers): print "You have %d cheeses!" % cheese_count print "You have %d boxes of crackers!" % boxes...
阅读全文
摘要:# this one is like your scripts with argvdef print_two(*args):arg1, arg2 = args print "arg1: %r, arg2: %r" % (arg1, arg2)# ok, that *args is actually ...
阅读全文
摘要:from sys import argv from os.path import existsscript, from_file, to_file = argvprint "Copying from %s to %s" % (from_file, to_file)# we could do thes...
阅读全文
摘要:from sys import argvscript, filename = argvprint "We're going to erase %r." % filename print "If you don't want that, hit CTRL-C (^C)." print "If you ...
阅读全文
摘要:Defination:累积分布函数:The cumulative distribution function (CDF) does just that. The CDF at point x tells us whatfraction of events has occurred “to the l...
阅读全文
摘要:from sys import argvscript, filename = argvtxt = open(filename)print "Here's your file %r:" % filename print txt.read()print "Type the filename again:...
阅读全文
摘要:from sys import argvscript, user_name = argvprompt = '> 'print "Hi %s, I'm the %s script." % (user_name, script)print "I'd like to ask you a few quest...
阅读全文
摘要:from sys import argvscript, first, second, third = argvprint "The script is called:", scriptprint "Your first variable is:", firstprint "Your second v...
阅读全文
摘要:age = raw_input("How old are you? ")height = raw_input("How tall are you? ")weight = raw_input("How much do you weigh? ")print "So, you're %r old, %r ...
阅读全文
摘要:print "How old are you?",age = raw_input()print "How tall are you?",height = raw_input()print "How much do you weigh?",weight = raw_input()print "So, ...
阅读全文
摘要:核函数估计Demo Iimport sys,re,osimport numpy as npfrom scipy import stats import matplotlib.pylab as plt if __name__ == '__main__': # random data gra...
阅读全文
摘要:tabby_cat = "\tI'm tabbed in."persian_cat = "I'm split\non a line."backslash_cat = "I'm \\ a \\ cat."fat_cat = """I'll do a list:\t* Cat food\t* Fishi...
阅读全文
摘要:# Here's some new strange stuff, remember type it exactly.days = "Mon Tue Wed Thu Fri Sat Sun"months = "Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug"print "...
阅读全文
摘要:formatter = "%r %r %r %r"print formatter % (1, 2, 3, 4)print formatter % ("one", "two", "three", "four")print formatter % (True, False, False, True)pr...
阅读全文
摘要:print "Mary had a little lamb."print "Its fleece was white as %s." % 'snow'print "And everywhere that Mary went."print "." * 10 # what'd that do?end1 ...
阅读全文
摘要:x = "There are %d types of people." % 10binary = "binary"do_not = "don't"y = "Those who know %s and those who %s." % (binary, do_not)print xprint ypri...
阅读全文
摘要:my_name = 'Zed A. Shaw'my_age = 35 # not a liemy_height = 74 # inchesmy_weight = 180 # lbsmy_eyes = 'Blue'my_teeth = 'White'my_hair = 'Brown'print "Le...
阅读全文
摘要:As a first guess,you can start with Scott’s rule for the bin widthw = 3.5σ/ 3√n,where σ is the standarddeviation for the entire data set and n is the ...
阅读全文
摘要:点图,抖动图。http://jingyan.baidu.com/article/59703552eaf0fb8fc1074049.html横向或纵向加随机变量。其实也可以用气泡图。上为盗图。
阅读全文
摘要:cars = 100space_in_a_car = 4.0drivers = 30passengers = 90cars_not_driven = cars - driverscars_driven = driverscarpool_capacity = cars_driven * space_i...
阅读全文
摘要:print "I will now count my chickens:"print "Hens", 25 + 30 / 6print "Roosters", 100 - 25 * 3 % 4print "Now I will count the eggs:"print 3 + 2 + 1 - 5 ...
阅读全文
摘要:# A comment, this is so you can read your program later.# Anything after the # is ignored by python.print "I could have code like this." # and the com...
阅读全文
摘要:print "Hello World!" print "Hello Again" print "I like typing this."print "This is fun." print 'Yay! Printing.'print "I'd much rather you 'not'." prin...
阅读全文
浙公网安备 33010602011771号