title: Construct new column from existing columns without re specifying dataframe in pandas
body: <p>If you want to create a new column in a dataframe from other columns, you can write it pretty concise in R. In Python however I have not find a way yet to do this because I have to state the dataframe everytime I use a column if I'm not mistaken. I there a way to state once which dataframe to use, after which you only have to specify the columns? I put two examples below to illustrate my point.</p>
  
  <p>In Python:</p>
  
  <pre><code>my_dataframe=pd.DataFrame({'col1':[1.0,2.0,3.0],
                   'col2':[4.0,5.0,6.0],
                   'col3':[0.25,0.25,0.25],
                   'first_column':[0.5,0.5,0.5],
                   'second_column':[1.0,2.0,3.0],
                   'third_column':[4.0,5.0,6.0],
                   'fourth_column':[0.25,0.25,0.25]})
  
  my_dataframe['new_column'] = my_dataframe['col1'] - (my_dataframe['third_column'] / my_dataframe['fourth_column']) * my_dataframe['second_column']
  </code></pre>
  
  <p>In R</p>
  
  <pre><code>my_dataframe &lt;- data_frame(col1 = c(1,2,3),
                             col2 = c(4,5,6),
                             col3 = c(0.25, 0.25, 0.25),
                             first_column = c(0.5, 0.5, 0.5),
                             second_column = c(1, 2, 3),
                             third_column = c(4, 5, 6),
                             fourth_column = c(0.25, 0.25, 0.25))
  
  my_dataframe &lt;- my_dataframe %&gt;% mutate(new_column = col1 - (third_column / fourth_column) * second_column)
  </code></pre>
  
  <p>The closest I can get to is using a lambda as in the example below, which is pretty clean, however the column auto-complete function does not work. My question therefore is, is there another method I haven't thought of which is both clean and provides an auto-complete?</p>
  
  <pre><code>df = pd.DataFrame({'A': [1, 2, 3]})
  df.assign(B=df.A, C=lambda x:x['A']+ x['B'])
  </code></pre>