title: Run an OLS regression with Pandas Data Frame
body: <p>I have a <code>pandas</code> data frame and I would like to able to predict the values of column A from the values in columns B and C. Here is a toy example:</p>
  
  <pre><code>import pandas as pd
  df = pd.DataFrame({"A": [10,20,30,40,50], 
                     "B": [20, 30, 10, 40, 50], 
                     "C": [32, 234, 23, 23, 42523]})
  </code></pre>
  
  <p>Ideally, I would have something like <code>ols(A ~ B + C, data = df)</code> but when I look at the <a href="http://scikit-learn.org/stable/auto_examples/linear_model/plot_ols.html" rel="noreferrer">examples</a> from algorithm libraries like <code>scikit-learn</code> it appears to feed the data to the model with a list of rows instead of columns. This would require me to reformat the data into lists inside lists, which seems to defeat the purpose of using pandas in the first place. What is the most pythonic way to run an OLS regression (or any machine learning algorithm more generally) on data in a pandas data frame? </p>