博客
关于我
prod()与cumprod()区别cumsum()
阅读量:346 次
发布时间:2019-03-04

本文共 819 字,大约阅读时间需要 2 分钟。

  • pandas.Series.cumprod

cumprod()累积连乘

Series.cumprod(axis=None, skipna=True, *args, **kwargs)#实现功能:Return cumulative product over a DataFrame or Series axis.#实现功能:Returns a DataFrame or Series of the same size containing the cumulative product.#return:scalar or Series

cumsum()累积连加

  • pandas.Series.prod
Series.prod(axis=None, skipna=None, level=None, numeric_only=None, min_count=0, **kwargs)# 实现功能:Return the product of the values for the requested axis.# return:scalar or Series

优点没看明白,因为常规情况下,所用的.prod()并非pandas下的函数,而是numpy下的函数。

  • numpy.prod
numpy.prod(a, axis=None, dtype=None, out=None, keepdims=
)# 实现功能:Return the product of array elements over a given axis.# return:product_along_axis : ndarray

返回给定轴上数组元素的乘积。

跟cumprod不同,cumprod是计算当前一个累积乘上前面所有的数据,更多是一个list;prod返回的是给定这个轴上最终一个值。

.
.
.
2019-03-22 16:24:33写于上海

转载地址:http://xgge.baihongyu.com/

你可能感兴趣的文章
MySQL高级-触发器
查看>>
Mysql高级——锁
查看>>
mysql高级查询~分页查询
查看>>
mysql高级查询之多条件的过滤查询
查看>>
MySQL高级配置
查看>>
MySQL高频面试题
查看>>
MySQL高频面试题的灵魂拷问
查看>>
MySQL(1)的使用 | SQL
查看>>
MySQL(2)DDL详解
查看>>
MySQL(3)DML详解
查看>>
MySQL(4)运算符 | 关联查询详解
查看>>
MySQL(5)条件查询 | 单行函数 | 事务详解
查看>>
Mysql,group by分组查询、order by排序查询、join连接查询、union联合查询
查看>>
Mysql,sql文件导入和导出
查看>>
MYSQL:int类型升级到bigint,对PHP开发语言影响
查看>>
Mysql:mysql 5.X 报错 ERROR 1193 (HY000): Unknown system variable ‘validate_password_length‘
查看>>
MySQL:MySQL执行一条SQL查询语句的执行过程
查看>>
Mysql:SQL性能分析
查看>>
mysql:SQL按时间查询方法总结
查看>>
MySQL:什么样的字段适合加索引?什么样的字段不适合加索引
查看>>