
python
成长的小牛233
不辜负每一份热爱
展开
-
python机器学习常用包下载安装以及使用案例汇总
python安装教程(Windows系统,python3.7为例) https://blog.youkuaiyun.com/weixin_40844416/article/details/80889165 在pycharm中切换python版本的方法 https://blog.youkuaiyun.com/sgfmby1994/article/details/77876873 Window...原创 2019-03-14 10:28:10 · 2088 阅读 · 0 评论 -
python练习代码保存
#coding=utf-8print('中国人')"""Python 保留字:and, exec, not, assert, finally, or, break, for, pass, class, from, print, continue, global, raise, def, if, return, del, import, try, elif, in, while, else...原创 2019-03-13 20:25:28 · 1311 阅读 · 0 评论 -
python运算符重载
重载符模板代码:class Vector: def __init__(self, a, b): self.a = a self.b = b def __str__(self): return 'Vector (%d, %d)' % (self.a, self.b) def __add__(self, other):...原创 2019-03-13 20:23:23 · 127 阅读 · 0 评论 -
python对象使用
模板代码:class People: '所有员工的基类' #构造函数 def __init__(self, user_id, user_name): self.user_id = user_id self.user_name = user_name #析构函数 def __del__(self): c...原创 2019-03-13 19:25:56 · 143 阅读 · 0 评论 -
python正则表达式使用
模板代码:import re #python 自1.5版本增加了re模块,它提供了Perl风格的正则表达式模式print(re.match('www', 'www.baidu.com').span()) #在起初位置匹配line = "Cats are smarter than dogs"matchObj = re.match( r'(.*) are (.*?) .*', line, ...原创 2019-03-13 19:24:07 · 142 阅读 · 0 评论 -
【链接保存】十分钟上手sklearn:安装,获取数据,数据预处理
简书地址:https://www.jianshu.com/p/a9168803edc6博主地址:http://blackblog.tech/2018/02/05/%E5%8D%81%E5%88%86%E9%92%9F%E4%B8%8A%E6%89%8Bsklearn-1/转载 2019-03-20 19:33:35 · 184 阅读 · 0 评论 -
【链接保存】十分钟上手sklearn:特征提取,常用模型,交叉验证
原博客地址:http://blackblog.tech/2018/02/05/%E5%8D%81%E5%88%86%E9%92%9F%E4%B8%8A%E6%89%8Bsklearn-1/简书地址:https://www.jianshu.com/p/731610dca805转载 2019-03-20 19:31:38 · 213 阅读 · 0 评论 -
【转】Python实现使用NLTK的快速自动关键字提取算法
Using pippip install rake-nltkDirectly from the repositorygit clone https://github.com/csurfer/rake-nltk.gitpython rake-nltk/setup.py installQuick startfrom rake_nltk import Rake# Uses...原创 2019-03-16 20:05:13 · 3387 阅读 · 0 评论 -
python利用jieba(textRank、TFIDF)提取关键字
from jieba import analyseprint("tfidf: ")tfidf = analyse.extract_tagstext = "线程是程序执行时的最小单位,它是进程的一个执行流,\是CPU调度和分派的基本单位,一个进程可以由很多个线程组成,\线程间共享进程的所有资源,每个线程有自己的堆栈和局部变量。\线程由CPU独立调度执行,在多CP...原创 2019-03-16 19:47:16 · 2987 阅读 · 0 评论 -
python类似于java的重写toString方法
python类中的特殊方法: __str__(self)用来重写people类:class People: '所有员工的基类' #构造函数 def __init__(self, user_id, user_name): self.user_id = user_id self.user_name = user_name #...原创 2019-03-11 21:14:23 · 11724 阅读 · 0 评论 -
python dir()函数使用
您可以使用内置的dir()函数列出一个定义对象的标识符。例如,对于一个模块,包括在模块中定义的函数,类和变量。当你给dir()提供一个模块名字时,它返回在那个模块中定义的名字的列表。当没有为其提供参数时, 它返回当前模块中定义的名字的列表。dir() 函数举例:>>> import sys # 获得属性列表,在这里是sys模块的属性列表>>> dir(...转载 2019-03-19 17:20:26 · 3140 阅读 · 1 评论 -
【kaggle入门题一】Titanic: Machine Learning from Disaster
原题:Start here if...You're new to data science and machine learning, or looking for a simple intro to the Kaggle prediction competitions.Competition DescriptionThe sinking of the RMS Titanic is...原创 2019-03-14 18:40:49 · 603 阅读 · 0 评论 -
python文件操作以及相对路径和绝对路径问题
绝对路径: PROJECT_ROOT = os.path.dirname(os.path.realpath(__file__))#获取项目根目录 path = os.path.join(PROJECT_ROOT,"data\\edge\\0_fuse.txt") #文件路径 edgeMap = np.loadtxt(path)相对路径:path = ...原创 2019-03-14 11:04:00 · 2768 阅读 · 0 评论 -
python机器学习常用包
总结了一些常用的工具:Numpy| 必用的科学计算基础包,底层由C实现,计算速度快。 Pandas| 提供了高性能、易用的数据结构及数据分析工具。 seaborn| 数据可视化 NLTK| 自然语言工具包,集成了很多自然语言相关的算法和资源。 Stanford CoreNLP| Stanford的自然语言工具包,可以通过NLTK调用。 Gensim| 主题模型工具...原创 2019-03-14 10:40:09 · 13347 阅读 · 0 评论 -
【工作】python识别不同国家语言类型
优秀文章推荐:地址:Python使用谷歌langdetect检测语言地址:Python3:语言探测工具langdetect和langid支持的语言类型:支持检测55种语言: af, ar, bg, bn, ca, cs, cy, da, de, el, en, es, et, fa, fi, fr, gu, he, hi, hr, hu, id, it, ja, kn, ko...原创 2019-05-06 20:16:50 · 7407 阅读 · 0 评论