title: how to dynamically choose row labels using tabulate in python
body: <p>I have a dictionary where the keys are strings and the values are lists of integers.  It is created as follows:</p>
  
  <pre><code>table_dict_of_lists = {}
  for label in return_dict_keys:
      temp_list = []
      for dict_list in stats_list_dict_list:
          temp_list.append(len(dict_list[label]))
      table_dict_of_lists[label] = temp_list
  </code></pre>
  
  <p>When I run the following:</p>
  
  <pre><code>for k, v in table_dict_of_lists.iteritems():
      print k, v
  </code></pre>
  
  <p>I get the following:</p>
  
  <pre><code>agentsGtX [566, 0, 0, 69, 134]
  pure_user_dict [11818, 0, 0, 627, 1910]
  inv_a_id_user_id [857, 0, 0, 73, 135]
  user_email_id_dict [18005, 0, 0, 800, 2669]
  ruurl_set [1288, 0, 0, 107, 247]
  user_id_invite_dict [9772, 0, 0, 473, 1578]
  pure_users_with_agents_dict [11060, 0, 0, 580, 1825]
  user_id_email_dict [18066, 0, 0, 800, 2682]
  </code></pre>
  
  <p>This was all in the service of trying to dynamically print this data to table using <code>tabulate</code>.</p>
  
  <p>I've got:</p>
  
  <pre><code>first_table = table_dict_of_lists
  f.write(tabulate(first_table, headers = "keys"))
  </code></pre>
  
  <p>Needless to say, this puts the the keys as the column headers.  I've looked <a href="https://pypi.python.org/pypi/tabulate" rel="nofollow">here</a> but I don't see the answer.</p>
  
  <p>How to I get the keys as label rows?</p>