reduce()之js与python
最近在自学python基础,发现很多js中的内置函数python中都存在,甚至比js更加简洁,下面说一下reduce()在js和python中的用法,做个对比便于记忆。
reduce()简介:
reduce的原意为减少,缩小;在js中为数组的内置方法,在python中则是一个内置方法,可以对可迭代数据集合做处理。
js中的reduce:
reduce
为数组中的每一个元素依次执行callback
函数,不包括数组中被删除或从未被赋值的元素
语法:
因为js中reduce为数组的内置方法,所以使用时要与数组一起使用,即:
arr.reduce(function(accumulator
,currentValue,index,array){
...
}, initialValue);
参数说明:
第一个参数为回调函数function,包含四个参数:
accumulator
累计器累计回调的返回值; 它是上一次调用回调时返回的累积值,或initialValue
(见于下方)。
currentValue:
数组中正在处理的元素。
index:(可选)
数组中正在处理的当前元素的索引。 如果提供了initialValue
,则起始索引号为0,否则从索引1起始。
array:(可选)
调用reduce()
的数组
第二个参数为初始值:
initialValue(可选)
返回值:
函数累计处理的结果
注意:回调函数第一次执行时,accumulator
和currentValue
的取值有两种情况:
1)如果调用reduce()
时提供了initialValue
,accumulator
取值为initialValue
,currentValue
取数组中的第一个值;
2)如果没有提供 initialValue
,那么accumulator
取数组中的第一个值,currentValue
取数组中的第二个值。
如果数组为空且没有提供initialValue
,会抛出TypeError
。
如果数组仅有一个元素(无论位置如何)并且没有提供initialValue
, 或者有提供initialValue
但是数组为空,那么此唯一值将被返回并且callback
不会被执行。
举例:
[0, 1, 2, 3, 4].reduce(function(accumulator, currentValue, currentIndex, array){
return accumulator + currentValue;
});
callback 被调用四次,每次调用的参数和返回值如下表:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAA/gAAADDCAYAAAA2jrpkAAAgAElEQVR4Xu2df8gfx33nPw9JI/IclJOcpkdbSxE2XC+EEIii69mq/xCuZcxd3NzJOcXnhFZJzEGKrMot5LDlEMvhDI0VSbRwODldcVNH1Kapc4exXOM/XNtpZQWCCb47cJEip/0jjfUcB/cEpQnPsT+/+2N2d2a+s/udnXnpL0nf2Zn5vD7vmd337uzs2tbW1pbwBwIQgA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NhCETYEMPg21CI8hgkmwqR7HjKa9DxBdE+LADrWwkQhzwmgY88TRPdmS4CxNdvUrbTjGPyV4p9P40ww88lVLD1Fk7FkOuw40XHY+Y0lOnQcS6aJc2oCjK2piYfRHgY/jDyOHgUTzOiIacCQAJo0BEZxLwmgYy/TQqcMCaBjQ2AUh4AmAcaWJiiK1Qi0DD58IAABCEAAAhCAAAQgAAEIQAACEJgngV27bkg7vra1tbU1zxDoNQQgAAEIQAACEIAABCAAAQhAAAIFAQw+WoAABCAAAQhAAAIQgAAEIAABCARA4P8DA3mWLQVS9j0AAAAASUVORK5CYII=" alt="" />
由reduce
返回的值将是最后一次回调返回值(10)。
更详细的讲解请参考:
https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce
python中的reduce():
描述:
reduce() 函数会对参数序列中元素进行累积。
函数将一个可迭代的数据集合(链表,元组等)中的所有数据进行下列操作:用传给 reduce 中的函数 function(有两个参数)先对集合中的第 1、2 个元素进行操作,得到的结果再与第三个数据用 function 函数运算,最后得到一个结果。
语法:
python中的reduce可处理的数据不仅仅局限于列表,所有可迭代数据均在处理范围之内
reduce(function, iterable[, initializer])
参数:
function:回调函数,有两个参数,与js的前两个参数相同
accumulator
累计器累计回调的返回值; 它是上一次调用回调时返回的累积值,或initialValue
(见于下方)。
currentValue:
数组中正在处理的元素。
iterable:
可迭代对象:类比与js中的arr
initializer:(可选)
初始参数:类比于js中的第二个参数
举例:
>>>def add(x, y) : # 两数相加
... return x + y
...
>>> reduce(add, [1,2,3,4,5]) # 计算列表和:1+2+3+4+5
15
>>> reduce(lambda x, y: x+y, [1,2,3,4,5]) # 使用 lambda 匿名函数
15
reduce(add, [1,2,3,4,5]) ==> add( add( add( add(1, 2), 3), 4), 5)
以上是js和python的reduce函数整理,可以看出其实很像,区别在于使用形式不同,不得不承认的是python使用起来更加简单并且可处理的数据类型更加多,
如果js想用reduce想用来处理其他可迭代对象可能要使用到call,apply之类的方法才行了
reduce()之js与python的更多相关文章
- [翻译] 比较 Node.js,Python,Java,C# 和 Go 的 AWS Lambda 性能
[翻译] 比较 Node.js,Python,Java,C# 和 Go 的 AWS Lambda 性能 原文: Comparing AWS Lambda performance of Node.js, ...
- 火星坐标、百度坐标、WGS84坐标转换代码(JS、python版)
火星坐标.百度坐标.WGS84坐标转换代码(JS.python版) 一.JS版本源码 github:https://github.com/wandergis/coordTransform /** * ...
- 5种语言混合编程:C++、JS、python、Lisp、汇编
/* 混合C++.JS.python.Lisp.汇编 1种语言,5种语法 */ main { //C++ vector<int> v; v.push(2); putsl(v.size()) ...
- 对比Node.js和Python 帮你确定理想编程解决方案!
世上没有最好的编程语言.有些编程语言比其他编程语言用于更具体的事情.比如,你可能需要移动应用程序,网络应用程序或更专业化的系统,则可能会有特定的语言.但是我们暂时假设你需要的是一个相对来说比较简单的网 ...
- Node.js 和 Python之间如何进行选择?
转载请注明出处:葡萄城官网,葡萄城为开发者提供专业的开发工具.解决方案和服务,赋能开发者. 原文出处:https://dzone.com/articles/nodejs-vs-python-which ...
- PHP、JS、Python,数据库 获取今天是星期几了?[开发篇]
额,这个看起来是一个好简单的问题,但是真正到自己去一行行写的时候,又给忘了,妈蛋.有空就看看吧.今天是星期几?下面就来看看几种不同语言的实现吧! PHP语言 输出当前时间: echo date('Y- ...
- JS/Java/Python格式化金额
//java代码 public static void main(String[] args) { DecimalFormat myformat = new DecimalFormat(); ...
- 前端语言之js(对比python快速入门)
昨日内容回顾 浮动 定位 溢出 透明度 模态框 今日内容概要 变量与常量 基本数据类型 数据类型内置方法 函数 常见内置对象 BOM与DOM操作 内容详细 1.变量与常量 # 在JS中声明变量需要使用 ...
- 给大家分享下坐标转换的代码的JS和Python两个版本的源码【转】
/** * Created by Wandergis on 2015/7/8. * 提供了百度坐标(BD09).国测局坐标(火星坐标,GCJ02).和WGS84坐标系之间的转换 */ /** * 百度 ...
随机推荐
- Jobs(一)前端页面
Java Web工程中的Intellij中Java Web工程的基本目录: 启动web工程后,显示的默认页面是index.html.需要注意的是,本来IDE自建的是index.jsp,我暂时改成了in ...
- MySql 8.0.11 客户端连接失败:2059 - Authentication plugin 'caching_sha2_password' cannot be loaded: ....
近期,换了新笔记本,重新安装了MySql数据库和客户端工具Navicat Premium 12.我是从官网上下载的MySql数据库,版本为8.0.11,链接:https://dev.mysql.com ...
- Springboot+mybatis+druid 配置多数据源
项目结构 application.yml配置文件 spring: application: name: service datasource: primary: jdbc-url: jdbc:orac ...
- vi学习笔记
dd 删除一行 de删除光标后面的单词 o向下插入一行 O向上插入一行 y复制 yy复制一行 ye复制光标后面的单词 p粘贴 == 代码自动布局 批量注释 ctrl + v , 输入大写I, 选 ...
- 一些常见css样式加选择器
先来个下拉框: 例: select是下拉框标签 multiple:指多选项 size :显示的选项数量 selected="selected":默认选中 —————————分割线— ...
- Dubbo 配置参数
关闭启动检查 在dubbo多模块项目启动的时候为了并行启动多个服务,缩短启动时间,需要解除模块之间的依赖检测 dubbo.consumer.check=false @Reference(check = ...
- extension(类扩展)和 category(类别)
extension(类扩展) 简单来说,extension在.m文件中添加,所以其权限为private,所以只能拿到源码的类添加extension.另外extension是编译时决议,和interfa ...
- Oracle问题总结
1.账号锁定了 2.忘记密码 3.Oracle create session权利 4.oracle中单引号和双引号的作用 5.不支持 insert into tableName values (... ...
- 多线程模块的condition对象
Python提供的Condition对象提供了对复杂线程同步问题的支持.Condition被称为条件变量,除了提供与Lock类似的acquire和release方法外,还提供了wait和notify方 ...
- 2.06_Python网络爬虫_正则表达式
一:爬虫的四个主要步骤 明确目标 (要知道你准备在哪个范围或者网站去搜索) 爬 (将所有的网站的内容全部爬下来) 取 (过滤和匹配我们需要的数据,去掉没用的数据) 处理数据(按照我们想要的方式存储和使 ...