title: Numpy.linalg.inv or Numpy.linalg.solve Type Error
body: <p>I'm trying to take the inverse by trying to implement $$(X^{T}X)^{-1}X^{T}y$$</p>
  
  <p>However, when doing so, I get the following error: <code>TypeError: No loop matching the specified signature and casting was found for ufunc inv</code></p>
  
  <p>My code is as follows: </p>
  
  <pre><code>import pandas as pd
  import numpy as np
  from numpy.linalg import inv
  
  
  data = pd.read_csv("Tbill10yr.csv")
  X = data.as_matrix()[:,1]
  X1 = X[:730]
  y_1 = X[1:,].reshape((730,1))
  Nobs = y_1.shape[0]
  X1 = np.c_[ np.ones( (Nobs,1) ) , X1]
  XX = np.dot(X1.T , X1)
  Xy = np.dot(X1.T , y_1)
  
  beta_hat = np.dot(inv(XX),Xy)
  </code></pre>
  
  <p>I later figured out that I had to use <code>beta_hat = np.dot(inv(XX.dtype(float)),Xy)</code></p>
  
  <p>Why is it necessary to do so ? Is there a proper way to go abouts this ? </p>
  
  <p>Any explanation is greatly apprecaited.</p>
  
  <p>Thanks</p>