I have pairs of 4 lists a and b with integer values such as list_1a = [1,2,3,...]
and list_1b = [8,11,15,...]
. The idea is that the integer values in list_1a
are now represented by the integer values in list_1b
, and the same for list_2a
and list_2b
etc.
Now I have a list of 4 columns final_list
which contained integer values corresponding to the a
lists. I want to map the values in final_list
to the values in the b
lists. What is the quickest way to do this in python ?
Is there a quicker way than using lists ?
Edit:
To clarify the question, take the following example:
list_1a = [1,2,3]
list_1b = [8,11,15]
list_2a = [5,6,7,8]
list_2b = [22,26,30,34]
list_3a = [11,12,13,14,18]
list_3b = [18,12,25,28,30]
list_4a = [51,61,72,82]
list_4b = [73,76,72,94]
- Note that some of these lists can contain more than a million entries (So maybe memory can be an issue)
- The lists do not have the same length
- All of the integer values in these lists are unique to their lists, i.e.
list_1a + list_1b
will never have a repeating integer value.
final_list
should look like final_list_b
after the mapping occurs
final_list_a = [[1,6,11,51],[3,6,14,72]]
final_list_b = [[8,26,18,73],[15,26,28,72]]
To put things into perspective, this questions is for a database application where these "lists" contain auto-generated key values