摘要: 1.用Hive对爬虫大作业产生的文本文件(或者英文词频统计下载的英文长篇小说)词频统计。 启动hadoop 用hdfs创建文件夹 上传英文文档bwyb.txt到hdfs上 启动hive并创建原始文档表: 导入文件数据: 查看导入结果 进行词频统计,结果放在表word_coune里: 查看统计结果: 阅读全文
posted @ 2018-05-25 18:07 153刘宇 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 通过hadoop上的hive完成WordCount 启动hadoop Hdfs上创建文件夹 上传文件至hdfs 启动Hive 创建原始文档表 导入文件内容到表docs并查看 用HQL进行词频统计,结果放在表word_count里 查看统计结果 阅读全文
posted @ 2018-05-16 17:47 153刘宇 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 用mapreduce 处理气象数据集 编写程序求每日最高最低气温,区间最高最低气温 1.气象数据集下载地址为:ftp://ftp.ncdc.noaa.gov/pub/data/noaa 2.按学号后三位下载不同年份月份的数据(例如201506110136号同学,就下载2013年以6开头的数据,看具体 阅读全文
posted @ 2018-05-09 21:30 153刘宇 阅读(221) 评论(1) 推荐(0) 编辑
摘要: 1. 以下关系型数据库中的表和数据,要求将其转换为适合于HBase存储的表并插入数据: 学生表(Student)(不包括最后一列) 学号(S_No) 姓名(S_Name) 性别(S_Sex) 年龄(S_Age) 课程(course) 2015001 Zhangsan male 23 2015003 阅读全文
posted @ 2018-05-08 21:25 153刘宇 阅读(81) 评论(0) 推荐(0) 编辑
摘要: import requestsfrom bs4 import BeautifulSoup def catchSoup(url): #url=‘http://cul.news.sina.com.cn/topline/2018-04-24/doc-ifzqvvsa2785251.shtml/‘ res= 阅读全文
posted @ 2018-04-30 19:11 153刘宇 阅读(142) 评论(0) 推荐(0) 编辑
摘要: import requests from bs4 import BeautifulSoup def get_soup(url): req = requests.get(url) req.encoding = 'utf-8' soup = BeautifulSoup(req.text, 'html.parser') return soup soup = get_so... 阅读全文
posted @ 2018-04-04 16:21 153刘宇 阅读(306) 评论(0) 推荐(0) 编辑
摘要: 0.可以新建一个用于练习的html文件,在浏览器中打开。 1.利用requests.get(url)获取网页页面的html文件 import requests newsurl='http://news.gzcc.cn/html/xiaoyuanxinwen/' res = requests.get( 阅读全文
posted @ 2018-03-29 21:01 153刘宇 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 下载一长篇中文文章。 从文件读取待分析文本。 news = open('gzccnews.txt','r',encoding = 'utf-8') 安装与使用jieba进行中文分词。 pip install jieba import jieba list(jieba.lcut(news)) 生成词频 阅读全文
posted @ 2018-03-28 16:05 153刘宇 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Can it really be sixty-two years ago that I first saw you? It is truly a lifetime, I know. But as I gaze into your eyes now, it seems like only yester 阅读全文
posted @ 2018-03-26 18:54 153刘宇 阅读(412) 评论(0) 推荐(0) 编辑
摘要: http://news.gzcc.cn/html/2017/xiaoyuanxinwen_1027/8443.html 取得校园新闻的编号 str='http://news.gzcc.cn/html/2017/xiaoyuanxinwen_1027/8443.html'print(str[-14:- 阅读全文
posted @ 2018-03-21 17:06 153刘宇 阅读(97) 评论(0) 推荐(0) 编辑