摘要: 1.用Hive对爬虫大作业产生的文本文件(或者英文词频统计下载的英文长篇小说)词频统计。 对英文长篇小说The Souls of Black Folk进行词频统计 1.start-all.sh 创建文件夹 1.hdfs dfs-mkdir storyinput 2.hdfs dfs-ls/usr/h 阅读全文
posted @ 2018-05-25 19:54 086刘伟锋 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 老师:MissDu 提交作业 老师:MissDu 提交作业 1. 用Python编写WordCount程序并提交任务 程序 WordCount 输入 一个包含大量单词的文本文件 输出 文件中每个单词及其出现次数(频数),并按照单词字母顺序排序,每个单词和其频数占一行,单词和频数之间有间隔 编写m 阅读全文
posted @ 2018-05-10 21:20 086刘伟锋 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 1. 以下关系型数据库中的表和数据,要求将其转换为适合于HBase存储的表并插入数据: 学生表(Student)(不包括最后一列) 学号(S_No) 姓名(S_Name) 性别(S_Sex) 年龄(S_Age) 课程(course) 2015001 Zhangsan male 23 2015003 阅读全文
posted @ 2018-05-04 18:52 086刘伟锋 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 一、Hadoop提供的Shell命令完成相同任务: 在本地Linux文件系统的“/home/hadoop/”目录下创建一个文件txt,里面可以随意输入一些单词.cd ./home/hadoopsudo mkdir a.txt 在本地查看文件位置(ls)ls 在本地显示文件内容touch a.txt 阅读全文
posted @ 2018-04-27 21:08 086刘伟锋 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 1.选一个自己感兴趣的主题或网站。(所有同学不能雷同) 2.用python 编写爬虫程序,从网络上爬取相关主题的数据。 3.对爬了的数据进行文本分析,生成词云。 4.对文本分析结果进行解释说明。 5.写一篇完整的博客,描述上述实现过程、遇到的问题及解决办法、数据分析思想及结论。 6.最后提交爬取的全 阅读全文
posted @ 2018-04-24 21:29 086刘伟锋 阅读(289) 评论(0) 推荐(0) 编辑
摘要: import requests import pandas import re from bs4 import BeautifulSoup from datetime import datetime def getNewsDetail(newsUrl): resd = requests.get(newsUrl) resd.encoding = 'utf-8' soup... 阅读全文
posted @ 2018-04-17 20:53 086刘伟锋 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 1. 用正则表达式判定邮箱是否输入正确。 2. 用正则表达式识别出全部电话号码。 3. 用正则表达式进行英文分词。re.split('',news) 4. 使用正则表达式取得新闻编号 5. 生成点击次数的Request URL 6. 获取点击次数 7. 将456步骤定义成一个函数 def getCl 阅读全文
posted @ 2018-04-11 22:17 086刘伟锋 阅读(146) 评论(0) 推荐(0) 编辑
摘要: import requests from datetime import datetime from bs4 import BeautifulSoup ksul='http://news.gzcc.cn/html/xiaoyuanxinwen/' res=requests.get(ksul) res.encoding='utf-8' soup=BeautifulSoup(res.text,'h... 阅读全文
posted @ 2018-04-02 20:11 086刘伟锋 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 1.利用requests.get(url)获取网页页面的html文件 import requests newsurl='http://news.gzcc.cn/html/xiaoyuanxinwen/' res = requests.get(newsurl) #返回response对象 res.en 阅读全文
posted @ 2018-03-29 19:40 086刘伟锋 阅读(125) 评论(0) 推荐(0) 编辑
摘要: fo =open("jj.txt","r") news=fo.read() fo.close sep='''",.!?:''' exclude={'the','she','you','it','a','and','is','in','so'} for i in sep: news= news.replace(i," ") wordLis 阅读全文
posted @ 2018-03-26 11:15 086刘伟锋 阅读(86) 评论(0) 推荐(0) 编辑