scikit-learn似乎是所有人的宠儿,但在我看来,PyMC更有魅力。PyMC主要用来做Bayesian分析。from pymc.examples import disaster_modelfrom pymc import MCMCM = MCMC(disaster_model)M.sample(iter=10000, burn=1000, thin=10)[-----------------100%-----------------] 10000 of 10000 complete in 1.4 sec
6.sh
sh库用来将shell命令作为函数导入到Python中。在bash中使用是非常实用的,但是在Python中不容易记住怎么使用(即递归搜索文件)。from sh import findfind("/tmp")/tmp/foo/tmp/foo/file1.json/tmp/foo/file2.json/tmp/foo/file3.json/tmp/foo/bar/file3.json
7.fuzzywuzzy
Fuzzywuzzy是一个可以对字符串进行模糊匹配的库,大家有空可以去查看源码。from fuzzywuzzy import fuzzfuzz.ratio("Hit me with your best shot", "Hit me with your pet shark")# 85
8.progressbar
progressbar是一个进度条库,该库提供了一个文本模式的progressbar。from progressbar import ProgressBarimport timepbar = ProgressBar(maxval=10)for i in range(1, 11):pbar.update(i)time.sleep(1)pbar.finish()# 60% |########################################################|