scala 对 字符串 Wordcount
来源:互联网 发布:寒秋seo 编辑:程序博客网 时间:2024/06/03 21:24
val a = "a,s,s,d,f,g,y,d,a,y,a,s,a,d,f,d,f"
val b = a.split(",").map(a => (a,1)).groupBy(_._1).mapValues(_.map(_._2).reduce(_+_))
val b = a.split(",").map(a => (a,1)).groupBy(_._1).mapValues(_.map(_._2).sum)
val b = a.split(",").map(a => (a,1)).groupBy(_._1).mapValues(_.map(_._2).reduceRight(_+_))
val b = a.split(",").map(a => (a,1)).groupBy(_._1).map(a => (a._1,a._2.map(_._2).reduce(_+_)))
阅读全文
0 0
- scala 对 字符串 Wordcount
- scala wordcount
- scala wordcount
- scala-wordcount
- Scala WordCount
- 用scala实现wordcount
- Scala实现WordCount功能
- scala akka wordcount程序
- Scala写的wordcount
- 不用scala运行wordcount
- scala 实现WordCount
- scala实现wordcount
- Scala之WordCount
- scala版wordcount
- scala sparkstreaming wordcount
- scala版本的wordCount
- Scala 入门 WordCount
- Scala-Actor并行wordcount
- JavaScript基础之Date
- (一)冒泡排序、选择排序、插入排序
- 学习Vue起航
- 排序算法总结
- oracle
- scala 对 字符串 Wordcount
- 建立 Cocoapods
- 数据结构预备知识总结
- KNN针对中文文本分类
- 好未来—求和
- Redis的AOF持久化
- Win10安装msi文件时出现2502,2503错误
- IOS查看包名、版本号、设备信息、签名、进程ID
- IAR——目录