text: Q:
  
  Python Matrix (list of lists) to dictionary
  
  Assume I have a matrix such as 
  [['ID', 'fName', 'lName'],
  ['A101', 'Mark', 'Smith'],
  ['A102', 'Jane', 'Smith'],
  ['A103', 'Mark', 'Twain'],
  ['A104', 'Ann', 'Lee']]
  
  Note that some of the cells are ''
  What I need to do is create 2 dictionaries from this matrix:
  
  use ID as key and fname and lname as its values
  use lName as key with ID and fName as values
  
  I thought it is as simple as getting each list (since the matrix is a list of lists) and use it to pass it to a dictionary as append, but I am having a hard time writing that part.
  To iterate the matrix for i in xrange (0, len(matrix)) and use i as the identifier for example matrix[i] but I am not sure if this is correct and what is the right way of making those dictionaries.
  I have Python 2.7.2
  
  A:
  
  >>> dict((x[0], (x[1], x[2])) for x in names[1:])
  {'A104': ('Ann', 'Lee'), 'A102': ('Jane', 'Smith'), 'A103': ('Mark', 'Twain'), 'A101': ('Mark', 'Smith')}
  >>> dict((x[2], (x[0], x[1])) for x in names[1:])
  {'Twain': ('A103', 'Mark'), 'Smith': ('A102', 'Jane'), 'Lee': ('A104', 'Ann')}
  
  A:
  
  From your comments on the other answers, I think this wants to be a two-step process, first getting a list of dicts instead of the "matrix" you have in your question, and then reworking it.
  For completeness, let's set
  list_of_lists = [['ID', 'fName', 'lName'],
                   ['A101', 'Mark', 'Smith'],
                   ['A102', 'Jane', 'Smith'],
                   ['A103', 'Mark', 'Twain'],
                   ['A104', 'Ann', 'Lee']]
  
  So, to get the list of lists you have into a list of dicts, you can do this:
  keys = list_of_lists[0]
  data = [dict(zip(keys, values)) for values in list_of_lists[1:]]
  
  data now contains a list of dictionaries.
  [{'ID': 'A101', 'fName': 'Mark', 'lName': 'Smith'},
   {'ID': 'A102', 'fName': 'Jane', 'lName': 'Smith'},
   {'ID': 'A103', 'fName': 'Mark', 'lName': 'Twain'},
   {'ID': 'A104', 'fName': 'Ann', 'lName': 'Lee'}]
  
  Now, it is simple to get the other list you want through comprehension:
  [{d['ID']: (d['fName'], d['lName'])} for d in data]
  
  I suspect you may be reading this list of lists from a file, perhaps using the csv module. If this is the case, you can read the data using the DictReader. So assuming your file looks like this:
  ID,fName,lName
  A101,Mark,Smith
  A102,Jane,Smith
  A103,Mark,Twain
  A104,Ann,Lee
  
  You can get data by doing
  import csv
  data = csv.DictReader(open('test.csv'))
  
  