[proFit-list] deleting columns (or rows) in a function

Scott Lasley slasley at space.umd.edu
Tue Feb 11 12:23:29 CST 2020


pf.DeleteColumns(window = , at = , count = ) or pf.DeleteRows(window = , at = , count = )  will delete count= columns or rows starting at position at= .  For example, if you have a data window named MyData and want to delete columns 3 and 4, use

pf.DeleteColumns(window='MyData', at=3, count=2)

This will delete the columns, so the columns to the right of the last deleted column will shift left to "fill in the hole" and their indexes will change.  If you just want to remove the data in a column you can use pf.SelectColumn(window = , column = , fromColumn = , toColumn = , options = ) and pf.Clear() 

pf.SelectColumn(window='MyData', firstColumn=3, lastColumn=4, options='forgetOld')
pf.Clear(window='MyData')

Or loop over the rows and use pf.ClearData(row, col) after setting the current window

pf.SetCurrentWindow('MyData')
for row in pf.RowRange():
    pf.ClearData(row, 3)
    pf.ClearData(row, 4)

Scott

> On Feb 11, 2020, at 9:14 AM, Dave <glasspusher at outofoptions.net> wrote:
> 
> Hi,
> 	Is there a way to programmatically delete columns (what I’m interested in right now) or rows from a data window in a Python script?
> 
> Dave




More information about the proFit-list mailing list