自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(29)
  • 资源 (3)
  • 问答 (2)
  • 收藏
  • 关注

原创 Python 基于Snownlp的情感分析(简单)

from snownlp import SnowNLP# 需要操作的句子file=open('text2.txt',mode='r')str=file.readline()str=str.replace('。','。\n')ls=str.split('\n')print(ls)def word_seg(str): ls1 = SnowNLP(str).words r...

2020-03-29 00:34:33 2007 1

原创 python 新词发现

wordseg.py:#coding=utf-8"""基于信息熵和互信息非监督中文分词Reference: http://www.matrix67.com/blog/archives/5044"""import reimport mathimport jsondef entropyOfList(ls): """ 给到一个列表(词,频次), 计算熵,用于...

2020-03-26 15:30:58 548

转载 Python 新词发现

https://blog.csdn.net/weixin_43378396/article/details/103848628?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522158514844019724811845128%2522%252C%2522scm%2522%253A%252220140713.130056874..%25...

2020-03-26 00:18:37 931

原创 Python 手写tf-idf(2)

#encoding:utf-8from collections import defaultdictfrom collections import Counterimport jiebaimport mathimport osdef read_single_file(file_name): #lines=[line.strip() for line in open(file_...

2020-03-24 15:27:22 229

转载 textrank 关键词提取-python实现

https://blog.csdn.net/y12345678904/article/details/77855936?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task

2020-03-23 22:17:28 781

原创 python replace()函数

太坑了

2020-03-19 15:20:00 1469 1

转载 python中join()函数的使用方法

https://www.cnblogs.com/sui776265233/p/10755525.html

2020-03-19 14:18:57 280

转载 python中去掉字符串中的\xa0、\t、\n,\u3000

https://blog.csdn.net/wangbowj123/article/details/78061618?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task

2020-03-19 14:06:18 2596

原创 python 爬虫并把网页中的文字写到txt中

import requestsfrom bs4 import BeautifulSoupfrom lxml import etreelink='http://www.chinanews.com/gn/2020/03-18/9129903.shtml'header={ 'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) A...

2020-03-18 23:16:14 2543

原创 python实战 豆瓣电影关键字爬虫

import requestsfrom bs4 import BeautifulSoupdef get_moves(): header = { 'user-agent': 'Mozilla/5.0 (Windows NT 10.0;Win64; x64) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/...

2020-03-18 21:24:58 498

原创 python requests如何看header

使用chrome浏览器自带的开发者工具查看http头的方法1.在网页任意地方右击选择审查元素或者按下 shift+ctrl+c, 打开chrome自带的调试工具;2.选择network标签, 刷新网页(在打开调试工具的情况下刷新);3.刷新后在左边找到该网页url,点击 后右边选择headers,就可以看到当前网页的http头了;...

2020-03-18 20:55:22 2825

原创 python对字典排序

import operatorx={1:2,3:4,4:3,2:1,0:0}sorted_x=sorted(x.items(),key=operator.itemgetter(1))print(sorted_x)

2020-03-18 20:33:46 140

原创 python小爬虫书写格式

import requestsfrom bs4 import BeautifulSouplink="https://3w.huanqiu.com/a/a4d1ef/3xT9bm0bPnl?agt=20&tt_group_id=6805406628087595533"headers={'User-Agent':'Mozilla/5.0(Windows;U;Windows NT 6...

2020-03-18 20:23:45 305

转载 python注释快捷键和取消注释快捷键

https://blog.csdn.net/u010590983/article/details/88087959

2020-03-18 20:04:24 4536

转载 Python中报错提示:TypeError: Student() takes no arguments

https://blog.csdn.net/xuantaiyang888/article/details/81035885

2020-03-18 19:17:26 2893

转载 “You are using pip version 19.0.3, however version 20.0.2 is available.”pip 更新报错解决办法

https://www.cnblogs.com/helloLuoLuo/p/12468732.html

2020-03-17 19:44:26 387

原创 考研数学 经验

数学:经历:高数部分初期:刚开始觉得自己数学基础不错,直接看李王全书,结果看完一遍感觉好像啥都没看一样,很懵逼。于是去借了教科书,根据自己的理解把知识点抄到本子,再听张宇的基础班视频一边做笔记,一遍之后感觉知识点清晰很多。马上重新拿起李王全书,高数部分一题一题看,会做自己写出来,不会的话一边看答案一边思索解法的奥妙。全书看完刷660题,那题目简直了,基本都得做几题,翻一次答案。线代...

2020-03-16 10:41:28 1023

转载 ACM标准输入输出C/C++版

https://blog.csdn.net/qiao1245/article/details/53020326?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task

2020-03-15 16:53:00 59

原创 python 中文分词去停留词,提取关键字。

from collections import defaultdictimport jiebaimport math#取出停用词表def stopwordlist(): stopwords = [line.strip() for line in open('chinesestoptxt.txt', encoding='UTF-8').readlines()] retur...

2020-03-09 12:09:03 1568 2

原创 python 中文分词和去停用词

import jieba#取出停用词表def stopwordlist(): stopwords = [line.strip() for line in open('chinesestoptxt.txt', encoding='UTF-8').readlines()] return stopwords#分词并去停用词def seg_word(line): seg...

2020-03-09 09:53:41 2477 5

转载 python 分词和去停用词

https://www.cnblogs.com/zuixime0515/p/9221156.html

2020-03-08 22:22:54 1032

原创 python 用结巴(jieba)进行中文分词

import jiebafilename="01.txt"file=open(filename,encoding='UTF-8',mode='r')ls=[]for i in file.readlines(): j=jieba.cut(i,cut_all=False) ls.append('/'.join(j))print(ls)

2020-03-08 22:02:17 352

原创 python 逗号分隔句子

filename="01.txt"file=open(filename,encoding='UTF-8',mode='r+')ls=[]lines=file.read()file.close()ls=lines.split('。')print(ls)file=open(filename,encoding='UTF-8',mode='w+')for i in range(len(l...

2020-03-08 21:45:50 1549

原创 简单用python不经第三方包实现TF_IDF算法

from collections import defaultdictimport mathdef loadDataSet(): dataset = [ ['my', 'dog', 'has', 'flea', 'problems', 'help', 'please'], # 切分的词条 ['maybe', 'not', 'take',...

2020-03-08 18:25:45 256

转载 python TF_IDF算法

https://www.jianshu.com/p/f3b92124cd2b

2020-03-08 12:03:57 94

原创 python map 键值对

states={ 'Oregon':'OR', 'Florida':'FL', 'California':'CA', 'New York':'NY', 'Michigan':'MI'}cities={ 'CA':'San Francisco', 'MI':'Detroit', 'FL':'Jacksonville'}cit...

2020-03-07 23:18:03 646

原创 python 逻辑术语

逻辑术语 在 python 中我们会用到下面的术语(字符或者词汇)来定义事物的真(True)或者假(False)。计算机的 逻辑就是在程序的某个位置检查这些字符或者变量组合在一起表达的结果是真是假。 • and 与 • or 或 • not 非 • != (not equal) 不等于 • == (equal) 等于 • >= (greater-than-eq...

2020-03-07 19:45:59 302

转载 NameError: name 'raw_input' is not defined

https://blog.csdn.net/hochean_/article/details/79582627

2020-03-07 17:40:36 109

转载 python 强制转化

https://www.cnblogs.com/zyuanlbj/p/11909992.html

2020-03-06 22:20:03 178

python的学习PPT

python 小白入学 多看看 内容详解 各种模块 比如说列表,字典,元组,模块与包,os的常用方法,文件的读写,多进程与多线程,numpy,pandas,matplotlib包的方法使用

2020-09-02

西安电子科技大学.zip

一、盲目搜索,图搜索(A算法,A*算法)。 二、与或图,博弈论、剪枝。 三、谓词逻辑,归结原理 四、知识 五、贝叶斯网络。

2020-03-05

福州大学863数据结构ppt.zip

福州大学863数据结构ppt,共有12章节。 第1章 数据结构与算法概论 第2章 表 第3章 栈 第4章 队列 第5章 排序与选择 第6章 树 第7章 图 第8章 集合 第9章 符号表 第10章 字典 第11章 优先队列 第12章 并查集

2020-01-10

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除