一、词频统计: 1.读文本文件生成RDD lines 2.将一行一行的文本分割成单词 words flatmap() 3.全部转换为小写 lower() 4.去掉长度小于3的单词 filter() 5.去掉停用词 6.转换成键值对 map() 7.统计词频 reduceByKey() 8.按字母顺序 ...
分类:
其他好文 时间:
2021-04-20 15:35:16
阅读次数:
0
python - How to interpret results of Spark OneHotEncoder - Stack Overflow ...
分类:
其他好文 时间:
2021-04-20 15:16:33
阅读次数:
0
Mac下Core Shell 使用lrzsz命令,上传,下载文件 新增~/.bashrc_Core_Shell # Bash support for Core Shell, reference: /etc/bashrc_Apple_Terminal on macOS # Report Working ...
分类:
系统相关 时间:
2021-04-20 15:02:28
阅读次数:
0
一、词频统计: 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
bash特殊变量 变量 含义 $0 函数名 \(n | n>=1,表示第一个、第二个、第n个参数、\)(10) $@ 全部参数 $* 全部参数 $# 参数个数 $_ 上一个命令的最后一个参数 $$ 当前shell进程ID $? 上一个命令的返回值 ...
分类:
其他好文 时间:
2021-04-20 14:55:25
阅读次数:
0
在/etc/profile.d目录里下新建 shell脚本 (设置alias别名命令的功能) 让新建的别名生效 设置完成后之际可以使用别名 gj 命令 执行poweroff一样效果的 ...
分类:
其他好文 时间:
2021-04-20 14:33:22
阅读次数:
0
1、编写脚本 createuser.sh,实现如下功能:使用一个用户名作为参数,如果 指定参数的用户存在,就显示其存在,否则添加之;显示添加的用户的id号等信息 read -p " input the user: " USER if id $USER &> /dev/null ; then echo ...
分类:
系统相关 时间:
2021-04-20 14:31:15
阅读次数:
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
解决问题-》有的放矢 1.spark 报错 Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient reso ...
分类:
其他好文 时间:
2021-04-19 15:56:23
阅读次数:
0
通过nginx -t获得 nginx=`nginx -t 2>&1 | grep configuration` if [ ! -z "$nginx" ];then nginxtmp="${nginx#*file}" nginxf="${nginxtmp%test*}" echo $nginxf fi ...
分类:
系统相关 时间:
2021-04-19 15:38:16
阅读次数:
0