title: Using pandas dataframe with Scipy
body: <p>Assuming a dataframe, <em>df</em>,  using pandas in the size of n x m.</p>
  <p>I would like to perfom linear algebra operation on <em>df</em>.</p>
  <p>Until now, I was unable to find a way to perfom directly linear algebra on <em>df</em>. What i was able to find is how to convert <em>df</em> from pandas format to Numpy using:</p>
  <pre><code>A = DataFrame.as_matrix
  </code></pre>
  <p>then I can simpy do</p>
  <pre><code>linalg.inv(A)
  </code></pre>
  <p>Is there a direct way of performing linear operation in Scipy using pandas dataframe? for example:</p>
  <pre><code>linalg.inv(df)
  </code></pre>
  <p>The reason I would like to use the linear algebra operation from scipy instead of Numpy is based on:</p>
  <blockquote>
  <p>In any case, SciPy contains more fully-featured versions of the linear algebra modules, as well as many other numerical algorithms. If you are doing scientific computing with python, you should probably install both NumPy and SciPy. Most new features belong in SciPy rather than NumPy.</p>
  </blockquote>
  <p>from <a href="https://www.quora.com/What-is-the-difference-between-NumPy-and-SciPy" rel="nofollow noreferrer">What-is-the-difference-between-NumPy-and-SciPy</a></p>