2013年11月14日

摘要: http://hi.baidu.com/black/item/307001d18715fc322a35c747Python内置了一些非常有趣但非常有用的函数,充分体现了Python的语言魅力!filter(function, sequence):对sequence中的item依次执行function... 阅读全文
posted @ 2013-11-14 16:23 江小鱼2015 阅读(109) 评论(0) 推荐(0) 编辑

2013年11月13日

摘要: 1.比较set中的内容(fp-growth实现时)a = set(['338','337'])b = [set(['337','338']),set(['339' ,'340'])]if a in b: print 'yes'else: print 'no' ... 阅读全文
posted @ 2013-11-13 19:27 江小鱼2015 阅读(141) 评论(0) 推荐(0) 编辑

2013年11月9日

摘要: 如果官方没有64-bit的包的话:http://www.lfd.uci.edu/~gohlke/pythonlibs/ 版权声明:本文为博主原创文章,未经博主允许不得转载。 阅读全文
posted @ 2013-11-09 19:37 江小鱼2015 阅读(112) 评论(0) 推荐(0) 编辑

2013年11月7日

摘要: simple way:import ospathname = "Untitled1.exe"os.system(pathname)with parametersubprocess.check_call(["Untitled1.exe",'parameter1','parameter2'],stdou... 阅读全文
posted @ 2013-11-07 11:09 江小鱼2015 阅读(174) 评论(0) 推荐(0) 编辑

2013年10月31日

摘要: import ospathname = r'G:\work\2.purchaseInterest\data'if not os.path.isdir(pathname): os.mkdir(pathname)for i in range(10): subname = pathname+'... 阅读全文
posted @ 2013-10-31 16:12 江小鱼2015 阅读(178) 评论(0) 推荐(0) 编辑
摘要: import itertoolsfor i in range(1,4): for e in itertools.combinations('abc',i): print(e), 版权声明:本文为博主原创文章,未经博主... 阅读全文
posted @ 2013-10-31 10:43 江小鱼2015 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 1. 先想后做。慢慢来,比较快。2 起名字很重要。起个简单的没有意义的名字,可能一开始比较爽,但后来就痛苦了。3.不要把东西都放在一个函数中,尽量模块化,这样可以用cProfile进行优化。 版权声明:本文为博主原创文章,未经博主允许不... 阅读全文
posted @ 2013-10-31 10:41 江小鱼2015 阅读(106) 评论(0) 推荐(0) 编辑
摘要: http://www.douban.com/note/69073375/概述:UUID是128位的全局唯一标识符,通常由32字节的字符串表示。它可以保证时间和空间的唯一性,也称为GUID,全称为:UUID —— Universally Unique IDentifier Python 中叫 UUID... 阅读全文
posted @ 2013-10-31 10:20 江小鱼2015 阅读(170) 评论(0) 推荐(0) 编辑
摘要: https://github.com/caesar0301/pyTree例子(decision tree):class innerNode(Node): def __init__(self,attribute,parent_node_assert,identifier=None, expand... 阅读全文
posted @ 2013-10-31 10:10 江小鱼2015 阅读(680) 评论(0) 推荐(0) 编辑
摘要: level = 1num = 70if level==1: a = ' '*(level-1)*4+'#'+'-'*(num-1)else: a = ' '*(level-1)*4+'#'+'-'*(num-1)content = "Specify the input and outpu... 阅读全文
posted @ 2013-10-31 10:04 江小鱼2015 阅读(133) 评论(0) 推荐(0) 编辑

导航