[proFit-list] running sum?

Chris Lee laserboy at fusemail.com
Thu Oct 13 03:25:59 CDT 2011


I had thought that you could choose to integrate and the x-column are the row numbers (so each value gets a weighting of one). But that doesn't work. It should be relatively simple to script, but because I don't know how you are arranging your spread sheets I haven't written something complete

import numpy as np

def findSelectedColumn(the_win):
    pf.SetCurrentWindow(the_win)
    cols = pf.ColRange()
    for j in cols:
        if pf.ColumnSelected(j):
            return j
    return None


the_win = pf.FrontmostWindow(pf.dataType)
the_col = findSelectedColumn(the_win)
num_rows = pf.RowRange()
the_data = np.asarray(pf.GetData(num_rows, j))
out_data = np.cumsum(the_data)
data_list = [the_data, out_data]
pf.SetData(1,j, data_list)

This script is likely to have bugs (for instance, it doesn't check for NaN's and I have no idea how it will handle empty cells in a column)

On Oct 11, 2011, at 10:42 PM, Dave Sopchak wrote:

> Hi all,
> 
> Is there a way to do a "running sum" of a column in pro fit? I mean, display the total of all values in a column thus far in the column next to it? 
> 
> Nothing jumped out at me immediately. I know this is kind of a spreadsheet thing to do, but it would help if I could do this all in pro fit.
> 
> Thanks for any and all…
> 
> Dave
> 
> 
> _______________________________________________
> proFit-list mailing list
> proFit-list at quantum-soft.com
> http://quantum-soft.com/mailman/listinfo/profit-list_quantum-soft.com




More information about the proFit-list mailing list