Working with PyDataSets - Check if row in dataset


I’m struggling a little with PyDataSets.
I’m trying to check if a row is already in a table and adding to it if not, but i’m not sure the best way to do this (I can do it stupidly using for loops, but would like to use the ‘in’ statement).

ds ="System/Mobile Client Sizes").value
pds = system.dataset.toPyDataSet(ds)
***if [size.width, size.height] not in pds:***
	ds = system.dataset.addRow(ds, 0, [size.width, size.height])
	system.tag.write("System/Mobile Client Sizes", ds)

the *** part doesn’t work.

A couple more questions:

  1. how do I not pass in the rowIndex parameter so that it adds the row onto the end? The function description says that this argument is optional and will default to adding the row to the end, however the function doesn’t take keyword arguments, so i’m not sure how to skip this in the argument passing?

  2. How would I check if a value exists in a single PyDataSet column? e.g. if "Bob" in pds["Name"]?

Thanks in advance!

PyDataSets can’t do this. If they were extended to have pds[columnNameOrNumber] return that column as a list, your syntax in (2) would work.
Native DataSets built on the BasicDataset type do have a getColumnAsList method that would give you something close to what you want.