一、词频统计: 1.读文本文件生成RDD lines lines = sc.textFile('file:///home/hadoop/word.txt') 2.将一行一行的文本分割成单词 words flatmap() words=lines.flatMap(lambda line:line.sp ...
分类:
其他好文 时间:
2021-04-20 15:02:06
阅读次数:
0
Markdown学习 标题 格式: #空格+标题名字,多级连多个# 字体 格式: 粗体两边加双星号,斜体两边单星号,斜体加粗三个星号,双波浪号是删除线 Hello,Word! Hello,Word! Hello,Word! Hello,Word! 引用 右大括号 分割线 格式:三个- 或 三个* 图 ...
分类:
其他好文 时间:
2021-04-20 14:54:06
阅读次数:
0
类别:1)0-1背包;2)分数背包 0-1背包使用贪心算法无法获得最优解 分数背包代码如下: def fractional_package(goods, w): """ :param data: [(价值,重量),...] :param w: 要拿取的总重量 :return:(拿走的数量,拿走的总价 ...
分类:
编程语言 时间:
2021-04-20 14:28:39
阅读次数:
0
一、词频统计: 读文本文件生成RDD lines lines=sc.textFile("file:///usr/local/spark/mycode/rdd/word.txt") lines.foreach(print) 将一行一行的文本分割成单词 words flatmap() words=lin ...
分类:
其他好文 时间:
2021-04-20 14:04:55
阅读次数:
0
「图论」第2章 最小生成树课堂过关 A. 【例题1】繁忙都市 题目 代码 prim #include <iostream> #include <cstdio> #include <cstring> using namespace std; #define N 310 #define M 200010 ...
分类:
其他好文 时间:
2021-04-19 16:02:22
阅读次数:
0
画个爱心向你表白 直接运用爱心的表达式 expression = ((x*0.05)**2+(y*0.1)**2-1)**3-(x*0.05)**2*(y*0.1)**3 知识点 input()方法:用来和用户交互,输入 input('Enter an English word:') str.spl ...
分类:
其他好文 时间:
2021-04-19 15:24:33
阅读次数:
0
word转pdf 在不能使用office组件(要收费)的情况下: framework OfficeDev/Open-Xml-PowerTools net core 1.4 版本以上 EricWhiteDev/Open-Xml-PowerTools 一个第三方包(改进) sergey-tihon/Cl ...
分类:
其他好文 时间:
2021-04-19 14:59:41
阅读次数:
0
grep grep 'word' filename.txt grep在进行搜索时,以行为单位进行处理 grep -n 代表显示行号 grep -v 代表反选择 grep -i 忽略大小写 grep 't[ea]st' 搜索test或tast grep '^goo' 搜索以goo开头的行 grep ' ...
分类:
其他好文 时间:
2021-04-19 14:54:38
阅读次数:
0
C#中对xml数据的读取和写入: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; using System.Xml; using ...
dict1={'name':'Lara','age':18} #判断键在不在字典中 for one in dict1: if 'name' in dict1:#或dict1.keys() print('key在字典中!') break #判断值在不在字典中 for one in dict1: if ...
分类:
编程语言 时间:
2021-04-16 12:04:54
阅读次数:
0