Add list data to table in prespective

Hi,

i have 3 list
a = [1,2,3]
b = ["good", "bad", "error"]
c = ["yes", "no","none"]

how to add this 3 list to table dataset in perspective?

Are each of these a row or a column?

You could try something like this.

a = [1,2,3]
b = ["good","bad","error"]
c = ["yes","no","none"]

headers =["a","b","c"]
data = []
i = 0
for i in range(0,3):
	data.append([a[i],b[i],c[i]])
test = system.dataset.toDataSet(headers,data)
print test

This might not fit your use case, but I hope this helps!
Thanks,

1 Like

one list is one column so i should have 3 columns

Take a look at system.dataset.addColumn()

1 Like

[quote="Dalton_Adams, post:3, topic:71088"]

a = [1,2,3]
b = ["good","bad","error"]
c = ["yes","no","none"]

headers =["a","b","c"]
data = []
i = 0
for i in range(0,3):
	data.append([a[i],b[i],c[i]])
test = system.dataset.toDataSet(headers,data)
print test

its working for prespective too thanks

@JordanCClark

In perspective it's returning dataset in array type

how to do that
image