博客
关于我
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:int类型升级到bigint,对PHP开发语言影响
查看>>
Mysql:mysql 5.X 报错 ERROR 1193 (HY000): Unknown system variable ‘validate_password_length‘
查看>>
MySQL:MySQL执行一条SQL查询语句的执行过程
查看>>
Mysql:SQL性能分析
查看>>
mysql:SQL按时间查询方法总结
查看>>
MySQL:什么样的字段适合加索引?什么样的字段不适合加索引
查看>>
MySQL:判断逗号分隔的字符串中是否包含某个字符串
查看>>
MySQL:某个ip连接mysql失败次数过多,导致ip锁定
查看>>
MySQL:索引失效场景总结
查看>>
Mysql:避免重复的插入数据方法汇总
查看>>
MyS中的IF
查看>>
M_Map工具箱简介及地理图形绘制
查看>>
m_Orchestrate learning system---二十二、html代码如何变的容易
查看>>
M×N 形状 numpy.ndarray 的滑动窗口
查看>>
m个苹果放入n个盘子问题
查看>>
n = 3 , while n , continue
查看>>
n 叉树后序遍历转换为链表问题的深入探讨
查看>>
N!
查看>>
N-Gram的基本原理
查看>>
n1 c语言程序,全国青少年软件编程等级考试C语言经典程序题10道七
查看>>