title: How to calculate pairwise Mutual Information for entire pandas dataset?
body: <p>I have 50 variables in my dataframe. 46 are dependant variables and 4 are independandt variables (precipitation, temperature, dew, snow). I want to calculate the mutual information of my dependant variables agaisnt my independant.</p>
  <p>So in the end i want a dataframe like this <a href="https://i.stack.imgur.com/Cgckp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Cgckp.png" alt="enter image description here" /></a></p>
  <p>Right now i am calculating it using the following but it's taking so long because i have to change my <strong>y</strong> each time</p>
  <pre><code>X = df[['Temperature', 'Precipitation','Dew','Snow']] # Features
  y = df[['N0037']] #target 
  
  from sklearn.feature_selection import mutual_info_regression
  mi = mutual_info_regression(X, y)
  mi /= np.max(mi)
  
  mi = pd.Series(mi)
  mi.index = X.columns
  mi.sort_values(ascending=False)
  mi
  </code></pre>