Issue creating dataset

ds = system.dataset.toDataSet(['Bin_No','Actual','Target'], [stringArray,TargetArray,ActualArray])
event.source.templateParams = ds

This creates a dataset of 3 columns- 'Bin_No','Actual','Target'.
But the problem here is, the data from StringArray is written as a row, whereas I need it to be written as a column,
How can I get the data in column format ??

The second argument to toDataSet is expected to a be a list of lists, in a format like this:

  [R1C1, R1C2, ...],
  [R2C1, R2C2, ...],

You will need to add code to 'pivot' your three lists of values. Python's builtin zip function may be useful to you.

1 Like

Thanks @PGriffith
The zip function on the second argument did the job.