title: dynamically assign name to key python
body: <p>I'm not sure if the title describes the problem correctly, so take a look:</p>
  
  <pre><code>def get_outer_edges(df, col):
      # first drop all zeros
      df[df.number != 0] #REPLACE NUMBER WITH col FROM ARGUMENTS ABOVE.
      ....
  </code></pre>
  
  <p>df.<code>number</code> is the name of the column that I'd like to filter on. </p>
  
  <p>What I'd like to do is be able to say</p>
  
  <p>df.<code>col</code> instead of df.<code>number</code> but <code>col</code> is a variable containing the string 'number'</p>
  
  <p>how do I do this?</p>
  
  <pre><code>def get_outer_edges(df, col):
      # first drop all zeros
      df[df.col != 0]
  </code></pre>
  
  <p>Also, what is this type of programming called? not 'dynamic programming' it has a name though right?</p>