Hadoop综合大作业

摘要: 开启Hadoop jps 创建文件 移动文件 启动Hive 创建数据库 结果 阅读全文
posted @ 2018-05-28 21:18 370蔡轩 阅读(171) 评论(0) 推荐(0) 编辑

理解MapReduce

摘要: 1.用Python编写WordCount程序并提交任务 程序 WordCount 输入 一个包含大量单词的文本文件 输出 文件中每个单词及其出现次数(频数),并按照单词字母顺序排序,每个单词和其频数占一行,单词和频数之间有间隔 阅读全文
posted @ 2018-05-10 21:51 370蔡轩 阅读(169) 评论(0) 推荐(0) 编辑

爬虫大作业

摘要: 获取网址 新闻内容 全部新闻列表 阅读全文
posted @ 2018-05-03 21:42 370蔡轩 阅读(179) 评论(0) 推荐(0) 编辑

数据结构化与保存

摘要: 1. 将新闻的正文内容保存到文本文件。 2. 将新闻数据结构化为字典的列表: 单条新闻的详情-->字典news news = {} news['title'] = soupd.select('.show-title')[0].text # c = soupd.select('#content')[0 阅读全文
posted @ 2018-04-16 12:01 370蔡轩 阅读(162) 评论(0) 推荐(0) 编辑

使用正则表达式,取得点击次数,函数抽离

摘要: 1. 2. 3. 4. 5. 6. 7. def getClickCount(newsUrl): newsId = re.search('\_(.*).html', newsUrl).group(1).split('/')[-1] clickUrl = 'http://oa.gzcc.cn/api. 阅读全文
posted @ 2018-04-11 21:51 370蔡轩 阅读(223) 评论(0) 推荐(0) 编辑

爬取校园新闻首页的新闻

摘要: 1. 用requests库和BeautifulSoup库,爬取校园新闻首页新闻的标题、链接、正文。 标题 链接 正文 2. 分析字符串,获取每篇新闻的发布时间,作者,来源,摄影等信息。 发布时间 3. 将其中的发布时间由str转换成datetime类型。 阅读全文
posted @ 2018-04-02 11:58 370蔡轩 阅读(264) 评论(0) 推荐(0) 编辑

网络爬虫练习

摘要: 网页 练习 阅读全文
posted @ 2018-03-30 21:02 370蔡轩 阅读(187) 评论(0) 推荐(0) 编辑

词频统计

摘要: # -*- coding: UTF-8 -*- str = '''Gotta Have You (The Weepies) Gray, quiet and tired and mean Picking at a worried seam I try to make you mad at me over the phone Red eyes and fire and signs I'm tak... 阅读全文
posted @ 2018-03-26 11:44 370蔡轩 阅读(191) 评论(0) 推荐(0) 编辑

组合数据类型练习

摘要: >>>classmate=['Mi','Bo','Tra','李三','Tra',56]>>> print(classmate)['Mi', 'Bo', 'Tra', '李三', 'Tra', 56]>>> f=['1','2','3']>>> f['1', '2', '3 阅读全文
posted @ 2018-03-22 11:54 370蔡轩 阅读(147) 评论(0) 推荐(0) 编辑

python

摘要: # -*- coding:UTF-8 -*- import turtle def newgoto(x, y): turtle.up() turtle.goto(x, y) turtle.down() def draw(x): turtle.begin_fill() for i in range(5): turtle.forward(... 阅读全文
posted @ 2018-03-19 10:05 370蔡轩 阅读(181) 评论(0) 推荐(0) 编辑