This function converts from a normal dataset to a PyDataset, which is a wrapper class which makes working with datasets more Python-esque. For more information on datasets and PyDatasets, see the Datasets page.
Dataset dataset - A dataset object to convert into a PyDataset.
PyDataset - The newly created PyDataset.
Gateway, Vision Client, Perspective Session
Code Snippet - Summing Values in a Column
# This example script would be added to a button that is in the same container as the table you are working with.
# It grabs the data of the Table component, and adds up the values in the first column, displaying the result to the user.
# Get a Table component's data.
table = event.source.parent.getComponent("Table")
data = system.dataset.toPyDataSet(table.data)
# Loop through the data, summing the Value column.
value = 0.0
for row in data:
value += row
# Show the user the sum of the Value column.
system.gui.messageBox("The value is: %f" % value)