title: Is there a way to check for linearly dependent columns in a dataframe?
body: <p>Is there a way to check for linear dependency for columns in a pandas dataframe? For example:</p>
  
  <pre><code>columns = ['A','B', 'C']
  df = pd.DataFrame(columns=columns)
  df.A = [0,2,3,4]
  df.B = df.A*2
  df.C = [8,3,5,4]
  print(df)
  
     A  B  C
  0  0  0  8
  1  2  4  3
  2  3  6  5
  3  4  8  4
  </code></pre>
  
  <p>Is there a way to show that column <code>B</code> is a linear combination of <code>A</code>, but <code>C</code> is an independent column? My ultimate goal is to run a poisson regression on a dataset, but I keep getting a <code>LinAlgError: Singular matrix</code> error, meaning no inverse exists of my dataframe and thus it contains dependent columns. </p>
  
  <p>I would like to come up with a programmatic way to check each feature and ensure there are no dependent columns.</p>