title: How to skip 'Nan' values in pandas dataframe and how to show regression line with rsquared on each plot
body: <p>Hello I have a dataframe and I want to loop from every column and plot it to the other. Data frame looks like that. </p>
  
  <pre><code>col1 col2 col3 col4 col5
  1    /           2    4
  2    3      /    4    7
  /    0      2    7    9
  1    2      3    4    5 
  </code></pre>
  
  <p>I want to plot col1 to col2 then to 3, 4,...etc. After the plot I want to do linear regression and show the regression line and rsquared value on the each plot. My attempt at the code is. </p>
  
  <pre><code>import pandas as pd
  from scipy.stats import linregress
  import statsmodels.api as sm
  import seaborn as sns
  from matplotlib.pyplot import close
  
  d = {'col1': [1, 2, 'Nan',1], 'col2': ['Nan',3, 0,2], 'col3': ['Nan', 'Nan', 2,3], 'col4':[ 2,4,7,4], 'col5':[4,7,9,5]}
  df = pd.DataFrame(data = d)
         for i in range(len(df.columns)):
          for j in range(len(df.columns)):
             if j != i : 
                 y = df[df.columns[i]].tolist()
                 x = df[df.columns[j]].tolist()
                 df = pd.DataFrame({i: x, j: y})
                 b = df.dropna(axis = 0, how='any')
                 model = sm.OLS(b[i], b[j]).fit()
                 if model.rsquared &gt;0.40:
                     b.plot.scatter(x= i, y = j)            
                     sns.regplot(x=i, y=j, data = b)
  </code></pre>
  
  <p>I chose to use OLS and seaborn, because in seaborn you easily plot regression line, but can't access the parameters(at least ive read), and with OLS you can easily show parameters. And the first problem I get, I don't know how to skip if value is not intiger. In theory when you plot col1 to col2 you would just get <code>x = [2,1]</code> and <code>y = [3,2]</code>. Would greatly appreciate your help in this problem :) Code doesn't to the fit nicely. And I want to display rsquared value on the plot. Is it a ways to plot sm.OLS linear plot on the same graph?</p>