I was wondering if it is possible to print a value that is inside a list of lists of tuples if you already know the indexes path.
1. List[i][j]
2. list2[x][y]
3. list3[z][w]
4. etc.
I would like to do something like this:
str( list[i][0 [0][2 [0][0]] )
To get the value at indexes 0,0 in the tuple at indexes 0,2 of a list at indexes i,0 of the main list.
Edit: Sorry, I'm learning. Console returns this:
[Record(items=set({'item1','item2'}),
id=6439,
stats=[OrderedStatistic(items_b=set({'item2'}),
items_a=set({'item1'}),
row=123,
col=321)]),
Record(...
I'm looking for the "row" value. I didn't know it had a name, it wasn't showed in my viewer.
Edit 2:
Improvement. It works, but I'm using a temporary variable because oldList[0].stats[0].row
returns a 'stats' object has no attribute row
.
for i in range(0, len(oldList)):
tmpList = oldList[i][2]
newList.append('ID:\t' + str(oldList[i][1])+ '\nROW:\t' + str(tmpList[0][2])
or
for i in range(0, len(oldList)):
tmpList = oldList[i][2]
newList.append('ID:\t' + str(oldList[i][1])+ '\nROW:\t' + str(tmpList[0].row)