博客
关于我
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调大sort_buffer_size,并发量一大,查询排序为啥又会变慢
查看>>
Mysql账号权限查询(grants)
查看>>
mysql转达梦7_达梦7的子查询分解示例说明
查看>>
MYSQL输入密码后闪退的解决方法
查看>>
MySQL迁移到达梦:如何轻松、高质量完成迁移任务
查看>>
mysql返回的时间和实际数据存储的时间有误差(java+mysql)
查看>>
mysql还有哪些自带的函数呢?别到处找了,看这个就够了。
查看>>
Mysql进入数据库
查看>>
mysql进阶 with-as 性能调优
查看>>
mysql进阶-查询优化-慢查询日志
查看>>
wargame narnia writeup
查看>>
MySQL进阶篇SQL优化(InnoDB锁问题排查与解决)
查看>>
Mysql进阶索引篇03——2个新特性,11+7条设计原则教你创建索引
查看>>
mysql远程连接设置
查看>>
MySql连接出现1251Client does not support authentication protocol requested by server解决方法
查看>>
Mysql连接时报时区错误
查看>>
MySql连接时提示:unknown Mysql server host
查看>>
MySQL连环炮,你扛得住嘛?
查看>>
mysql逗号分隔的字符串如何搜索
查看>>