Hello Folks,
I would like to perform basic math functions on columns of data resulting from image analysis.
At the moment I am copying the column to a list or array using a loop, like this;
for i in range (0, channelTable.RowCount, 1):
meanList.append(channelTable.GetValue(i,3))
This list can then be used to perform the basic math functions.
I would like to use instead use the Columns.CopyTo() capability, but cannot figure out the proper formatting of the arguments (array, index). The receiving array always has some error returning. I don't see any use of this in the OAD forum as an example unfortunately, or the GitHub page.
Has anyone used this successfully and have an example that I can follow?
Regards,
Dan
Columns.CopyTo() functionality - how to perform operation?
Hello Dan,DataColumnCollection.CopyTo(DataColumn[], Int32) Method
when you have a ZenTable like channelTable then ZenTable.Columns returns a DataColumnCollection.
Therefore Columns.CopyTo(...) is a function of DataColumnCollection.
The DataColumnCollection.CopyTo(...) command is part of .Net and described here
It says:
Copies the entire collection (of columns!) into an existing array (of DataColumn!), starting at a specified index within the array.
Do you really want to copy the columns? (A column is defined by its Name, data type, etc.)
As said before, CopyTo belongs to the .Net Framework and thus there are no examples in the OAD forum or on the GitHub page.