title: Getting the name of a variable as a string
body: <p>I already read <a href="https://stackoverflow.com/questions/251464/">How to get a function name as a string?</a>.</p>
  <p>How can I do the same for a variable? As opposed to functions, Python variables do not have the <code>__name__</code> attribute.</p>
  <p>In other words, if I have a variable such as:</p>
  <pre><code>foo = dict()
  foo['bar'] = 2
  </code></pre>
  <p>I am looking for a function/attribute, e.g. <code>retrieve_name()</code> in order to <a href="http://pandas.pydata.org/pandas-docs/dev/dsintro.html#from-a-list-of-dicts" rel="noreferrer">create a DataFrame in Pandas from this list</a>, where <strong>the column names</strong> are given by the names of the actual dictionaries:</p>
  <pre><code># List of dictionaries for my DataFrame
  list_of_dicts = [n_jobs, users, queues, priorities]
  columns = [retrieve_name(d) for d in list_of_dicts] 
  </code></pre>