title: changing numpy array to float
body: <p>I have a numpy array of type object. I want to find the columns with numerical values and cast them to float. Also I want to find the indices of the columns with object values.
  this is my attempt:</p>
  
  <pre><code>import numpy as np
  import pandas as pd
  
  df = pd.DataFrame({'A' : [1,2,3,4,5],'B' : ['A', 'A', 'C', 'D','B']})
  X = df.values.copy()
  obj_ind = []
  for ind in range(X.shape[1]):
      try:
          X[:,ind] = X[:,ind].astype(np.float32)
      except:
          obj_ind = np.append(obj_ind,ind)
  
  print obj_ind
  
  print X.dtype
  </code></pre>
  
  <p>and this is the output I get:</p>
  
  <pre><code>[ 1.]
  object
  </code></pre>