Please can you help, I am struggling how to create a multidimensional array from a loop. I am looping through rows in a data table and want to pass these to an array. Thanks Jay
from Spotfire.Dxp.Data import DataValueCursor
from System import DateTime, TimeSpan, DayOfWeek
from datetime import date
import time
#define ID
idcursor=DataValueCursor.Create[str](table.Columns["ID"])
#define actual date
actualcursor=DataValueCursor.Create[str](table.Columns["ActualDate"])
#define duration
durationcursor=DataValueCursor.Create[int](table.Columns["Duration"])
#define Start, # of Months and # of days
startcursor=DataValueCursor.Create[int](table.Columns["Start Months"])
monthcursor=DataValueCursor.Create[int](table.Columns["Number of Months"])
daycursor=DataValueCursor.Create[int](table.Columns["Number Of Days"])
#define Min and Max Dates
mincursor=DataValueCursor.Create[str](table.Columns["Min Date"])
maxcursor=DataValueCursor.Create[str](table.Columns["Max Date"])
myPanel = Document.ActivePageReference.FilterPanel
idxSet = myPanel.FilteringSchemeReference.FilteringSelectionReference.GetSelection(table).AsIndexSet()
bar = []
for row in table.GetRows(idxSet,idcursor,durationcursor,actualcursor,startcursor,monthcursor,daycursor):
#I would like this line to populate the array
bar.append(idcursor.CurrentValue)
bar
? – TehTris May 8 at 18:07idcursor
value because that's all you append tobar
. Have you tried appending the values of the other things in list form, likebar.append([idcursor,durationcursor,actualcursor])
and so on? – Dannnno May 8 at 18:18