
prod()与cumprod()区别cumsum()
发布日期:2021-05-07 14:28:36
浏览次数:10
分类:原创文章
本文共 839 字,大约阅读时间需要 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=<class numpy._globals._NoValue>)# 实现功能: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写于上海
发表评论
最新留言
网站不错 人气很旺了 加油
[***.192.178.218]2025年03月24日 07时37分19秒
关于作者

喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
量化新手初识流数据表
2019-03-04
Linux中常见的echo是什么意思
2019-03-04
国内量化交易现状总结
2019-03-04
阿里云云解析DNS各种概念深度剖析
2019-03-04
SQLite基础用法
2019-03-04
(20200328已解决)从docker容器内复制文件到宿主机
2019-03-04
理解Docker ulimit参数
2019-03-04
pandas.groupby().rank()用法详解
2019-03-04
Factor Exposure因子暴露
2019-03-04
理解zvt in Python on Quant
2019-03-04
将DataFrame作为邮件正文HTML发送 in Python
2019-03-04
理解Python系统下的时间格式
2019-03-04
《经济机器是怎样运行的》笔记(三)
2019-03-04
prod()与cumprod()区别cumsum()
2019-03-04
Python提升回测速度concurrnet.futures模块详解
2019-03-04
Python语言'类'概念再理解
2019-03-04
QTableView结构及用法
2019-03-04