I am getting "list indices must be integers or slices, not tuple" error while trying to generate list from list of tuples. list of tuples have the following structure:
[(29208, 8, 8, 8), (29209, 8, 8, 8), (29210, 8, 8, 8), (29211, 8, 8, 8)]
The first element in the tuple is a time series, other elements are state of some variables.
The loop for converting from list of tuples to simple list is following:
TimeAxis = []for n in lst:TimeAxis.append(lst[n][0])
Where lst has format as described above. For some reason it throws an error:
Traceback (most recent call last):File "X:\Temp\XXX_python_graph\RTT_Plot.py", line 30, in <module>Time.append(lst[n][0])
TypeError: list indices must be integers or slices, not tuple
I understand this is novice question, but other solutions on stackoverflow do not work. Thanks in advance.