title: How to find correlation coefficient r in excel sheet using pandas
body: <p>I have an Excel worksheet which is 250 rows by 10 column of data. My dependent variable is n_nnld_trp and I am trying to find which independent variables are highly correlated with it to use in a linear regression model.
  <a href="https://i.stack.imgur.com/le3uT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/le3uT.png" alt="enter image description here" /></a></p>
  <p>I want to make a table like this to summarize the correlation data as well as identify any cases of multi-collinearity using the equation in the picture:
  <a href="https://i.stack.imgur.com/QE6rZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QE6rZ.png" alt="enter image description here" /></a></p>
  <p>So far, I managed to use a pivot table to get the mean of each row with my dependent variable being n_hhld_trp:</p>
  <pre><code>trip_mean = pd.pivot_table(read_excel, index=['n_hhld_trip'],  
                  aggfunc=np.mean)
  </code></pre>
  <p>print(trip_mean.head())</p>
  <p>I'm finding it hard to make the table of correlation as shown above and I would welcome and appreciate any help.</p>