Some context: I have a dataset from 14 samples that each are comprised of two duplicate parts. Each duplicate part of each sample has sub-samples, and each of these have a location in which can be described by an x and y position where n x=10 and n y=10 (100 positions, per 2 duplicates, per 14 samples = 2800 Unique IDs).
So, each sub-sample has a unique ID that is comprised of sample'+'part'+'locationx'+'locationy
. Note this is not a product (I think!?) but a joined string comprised of each possible combination. Each unique ID has considerable amounts of numerical data attached to it. I wish to generate a list of the unique ID of each sub-sample, so that I can then use this to loop code efficiently. The unique IDs would be tedious to write out, for instance as a nested list.
I have read many posts about how to add a string to each element in a list. This can be achieved by a List Comprehension. That would speed things up. But, what about if you want to add each string in a list to each string in another list? That would speed things up mightily!
This sounds a little like building a multidimensional array, which can be achieved using lists, but not if those lists are strings (it seems to me!), only integers. I hope I'm wrong and someone can tell me so.
A downsized description of the concept using just two lists:
list1 = ['foo', 'fob', 'faz']
list2 = ['bar', 'bat', 'bump']
magic
list3 = ['foobar', 'fobbar', 'fazbar', 'foobat', 'fobbat', 'fazbat', 'foobump', 'fobbump', 'fazbump']