I need to build many sample data, each of which is stored in a list of integers. I want to create a list of many concatenated lists to build it with an enumeration (big_list) to get the x coordinate with a fixed offset. My current code is:
biglist = []
for n in xrange(number_of_lists):
biglist.extend(recordings[n][chosen_channel])
for x,y in enumerate(biglist):
print x,y
Notes: number_of_lists and selected_channel are integer parameters defined elsewhere, and for example, print x, y (in fact, there are other instructions for plotting points.
My question is: is there a better way, such as list recognition or another operation, to achieve the same result (a combined list) without a loop and a previously declared empty list?
thank
source
share