I have a dataset (or PyDataset).
I loop throw the data. Something like this:
for row in dataset:
print row["COLUMN_1"]
print row["COLUMN_2"]
print row["COLUMN_3"]
print row["COLUMN_4"]
print row["COLUMN_5"]
However, any of the columns could not exist (I can't know it.. ). Is there any way of accesing the data safely so it doesn't throw an exception?
I believe there is not a safe way. I'm really looking for any scripting tip to do it. The idea is to print the row or print 0 if the column doesn't exist.
Thanks!