上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 22 下一页
摘要: 经人提醒忘记发网址id的爬取过程了, http://www.beijing.gov.cn/hudong/hdjl/com.web.consult.consultDetail.flow?originalId=AH20021300174 AH20021300174为要爬取的内容 现代码如下: 1 imp 阅读全文
posted @ 2020-02-13 14:18 雾霾王者 阅读(242) 评论(0) 推荐(0) 编辑
摘要: 今天主要完成了信息领域热词分析系统的其他功能,如word导出功能,关系图以及热力关系图功能,搜索功能。 效果如下: 关系图: 热度关系图: 以及搜索功能 word导出 阅读全文
posted @ 2020-02-12 23:37 雾霾王者 阅读(317) 评论(1) 推荐(0) 编辑
摘要: 今天做了一天热词分析系统,效果如下: 展示页面: 解释页面: 词云页面: 热词引用页面: 阅读全文
posted @ 2020-02-12 01:04 雾霾王者 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 用pandas库的.drop_duplicates函数 代码如下: 1 import shutil 2 import pandas as pd 3 4 5 frame=pd.read_csv('E:/bdbk.csv',engine='python') 6 data = frame.drop_dup 阅读全文
posted @ 2020-02-11 02:09 雾霾王者 阅读(5526) 评论(0) 推荐(0) 编辑
摘要: 由于pip安装默认的访问地址为 http://pypi.python.org/simple/ 为外网,速度慢而且容易超时报错 国内常用的镜像源有 :阿里云 http://mirrors.aliyun.com/pypi/simple/ 中国科技大学 https://pypi.mirrors.ustc. 阅读全文
posted @ 2020-02-11 01:37 雾霾王者 阅读(300) 评论(2) 推荐(0) 编辑
摘要: 代码如下: 1 import shutil 2 3 readPath='E:/word4.txt' #要处理的文件 4 writePath='E:/word5.txt' #要写入的文件 5 lines_seen=set() 6 outfiile=open(writePath,'a+',encodin 阅读全文
posted @ 2020-02-10 22:02 雾霾王者 阅读(1477) 评论(0) 推荐(0) 编辑
摘要: 这个问题是Pycharm解释器的问题, 打开file >setting > 在如图所示界面点击add 在弹出的页面中选择python3的安装路径,可以用win10的搜索打开文件位置查看。 选择新路径,点击OK,发现不再报错。 阅读全文
posted @ 2020-02-10 21:52 雾霾王者 阅读(4116) 评论(0) 推荐(0) 编辑
摘要: 两个txt文件词汇,用换行符分隔。可以用代码将要处理的文件去掉另一个文件所包含的重复内容。 如: a.txt内容为: 衡山 泰山 西湖 紫禁城 b.txt内容为: 泰山 衡山 长白山 张三丰 将a.txt设为要处理的文件,将b.txt设为字典,则输出的c.txt文件为 c.txt 西湖 紫禁城 代码 阅读全文
posted @ 2020-02-10 21:44 雾霾王者 阅读(1264) 评论(0) 推荐(0) 编辑
摘要: 今天主要完成了根据爬取的txt文档,从百度分类从信息科学类爬取百度词条信息,并写入CSV格式文件。 txt格式文件如图: 为自己爬取内容分词后的结果。 代码如下: 1 import requests 2 from bs4 import BeautifulSoup 3 import csv 4 imp 阅读全文
posted @ 2020-02-10 21:37 雾霾王者 阅读(255) 评论(0) 推荐(0) 编辑
摘要: 源码如下: 1 import jieba 2 import io 3 import re 4 5 #jieba.load_userdict("E:/xinxi2.txt") 6 patton=re.compile(r'..') 7 8 #添加字典 9 def add_dict(): 10 f=ope 阅读全文
posted @ 2020-02-10 01:14 雾霾王者 阅读(3856) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 22 下一页