Map elements of a list of dictionary from another dictionary

I have a list of dictionaries like this where the key is the node and values are the friends (also nodes) of this node.

A= [{'756': ['7403','63708','8070','736','6092',]},
 {'3778':['46798','6812','327811','6838','37591']}]

there is another dict where I have the college corresponding to these friends e.g.

B=
756:IIMA
7403:Kirori
63708:RamLal
8070:IIMA
736:IIMA
6092:IIMB

I want to map the colleges corresponding to the nodes e.g.

AB=[{'IIMA': ['Kirori','RamLal','IIMA','IIMA','IIMB',]},
 {'...':['....','....','....','....','....']}]

What is the better ways than iterating over each element of A and merging B

Answer

As the question was initially labeled pandas, here is a pandas version:

import pandas as pd

(pd.concat(pd.Series(d) for d in A)  # make a Series of lists
   .apply(pd.Series)                 # transform the list to columns
   .applymap(lambda x: B.get(x,x))   # for each element, if existing, replace with value in B
)

output:

           0       1       2     3      4
756   Kirori  RamLal    IIMA  IIMA   IIMB
3778   46798    6812  327811  6838  37591