system.dataset.toDataSet Wrong Number of Columns

I’m stumped on why this won’t work. All I want is a dataset with one column and one row, but I get
Row 0 doesn't have the same number of columns as header list

	header = ['column']
	rows = ['MANHATTAN']
	system.dataset.toDataSet(header,rows)

The second argument to toDataSet needs to be a list of lists - one list containing each row, and each row being the actual values. rows = [['MANHATTAN']] would work.

2 Likes

Your rows variable needs to be list of lists. Since strings can be treated as lists of characters, it sees one row of nine columns containing one character each. Add another set of brackets.

2 Likes