str-api && map()、reduce()
来源:互联网 发布:淘宝那里设置破损补寄 编辑:程序博客网 时间:2024/06/02 05:09
1.String API
1.upper() 将str中的所有字母变成大写字母
2.lower() 将str中的所有字母变成小写字母
3.cpitalize() 将str中的字符串变成首字母大写,其余小写
4.title() 将str中的所有单词变成大写字母开头其余字母小写
5.str( item ) 类似于java语言中的toString方法将item强制转换为string类型
6.isupper() 判断str中是否全部为大写字母,返回bool
7.islower() 判断str中是否全部为小写字母,返回bool
8.istitle() 判断str中的单词是否都是第一个字母大写,其余字母为小写,返回bool
2.map(function,input_list)
map函数有两个参数,第一个参数为传入函数f(x),第二个为一个输入集合[x1,x2,x3,x4,...],返回一个集合为[f(x1),f(x2),f(x3),...]
3.reduce(function, input_list)
reduce函数有两个参数,第一个为传入的函数f(x,y),第二个为输入集合[x1,x2,x3,x4,...],返回f(f(x1,x2),x3),x4),..
4.filter(function,input_list)
filter函数有两个参数,第一个传入一个返回类型为bool的函数,第二个为输入集合,将所有function(input_item)为True的item作为一个新的list返回
5.sorted(input_list,function)
其中第二个输入参数是可选的,如果只有一个输入参数,则对input_list进行按大小排序并返回,如果想自定义排序方法,可以实现function(x1,x2)并传入。
0 0
- str-api && map()、reduce()
- Map/Reduce API 样例一
- Map/Reduce API样例二
- Spark RDD---api(map&reduce)
- map-reduce Java API操作及map reduce的配置
- 【Python】使用reduce和map函数实现str转int
- 坑爹的hadoop map reduce api
- Spark RDD API详解Map和Reduce
- Spark RDD API详解 Map和Reduce
- Spark RDD API详解 Map和Reduce
- Spark RDD API详解 Map和Reduce
- Spark RDD API详解 Map和Reduce
- map/reduce
- map reduce
- Map/Reduce
- map reduce
- Map Reduce
- map reduce
- Android层接收串口数据
- TFTP 配置 笔记
- 解决osgEarth中文显示乱码的几种方法
- 第三届ACM山东省赛 Pick apples [贪心+动规]
- mongodb java高级查询实例
- str-api && map()、reduce()
- WPF提取oracle数据库中数据显示到DataGrid控件上
- RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream capture process .
- DDMS中data打不开
- android开发基本知识点
- 构造方法(初学者求教)
- 机房重构---准备阶段总结
- Knapsack-Dynamic Programming
- Context