• matplotlib函数理解


    cumsum(),通常用于计算一个数组各行的累加值,函数用法是B = cumsum(A,dim),或B = cumsum(A)。

        def cumsum(self, axis=0, *args, **kwargs):
            """
            Cumulative sum of non-NA/null values.
    
            When performing the cumulative summation, any non-NA/null values will
            be skipped. The resulting SparseSeries will preserve the locations of
            NaN values, but the fill value will be `np.nan` regardless.
    
            Parameters
            ----------
            axis : {0}
    
            Returns
            -------
            cumsum : SparseSeries
            """

    举例说明:

    data数据,对盈利求和是37535

    # A1的cumsum()是前1行的数据之和;A2的cumsum()是前2行的数据之和(9173+5729=14902);……
    data.cumsum()------ A1 9173 A2 14902 A3 19713 A4 23307 A5 26502 A6 29528 A7 31906 A8 33876 A9 35753 A10 37535
    #Python程序段里的这条语句的意思是?
    p = 1.0*data.cumsum()/data.sum()
    # 1.0让数据浮点格式化
    #

  • 相关阅读:
    linux 中的vim的配置文件的位置
    centos find
    multi-cursor
    ctrlsf插件
    Vim的可视模式
    Vim的tagbar插件
    Vim的tag系统
    ~/.ctag的作用与配置
    在Vim里使用gtags-cscope
    查看Vim的option变量的值
  • 原文地址:https://www.cnblogs.com/daemonFlY/p/10659154.html
Copyright © 2020-2023  润新知