So I have this class called Data
And the class has two attributes; var_names and units
is it possible to append list elements of the list (which belongs to attribute units) to each element in the list called var_names? So when I make a new object called myData, the bellow output is possible (so the sublist [1,2,3,4] would be associated to id element?
>>> myData=Data([[1,2,3,4],["a","b","c","d"],
[2.3,2.1,2.5,3.1]],var_names=["id","name","length"])
>>> print myData
id name length
1 a 2.3
2 b 2.1
3 c 2.5
4 d 3.1
Or that's not possible? And be only achieved visually (way of formatting the output)
namedtuple?