title: How to force all strings to floats?
body: <p>I have a small dataframe, consisting of just two columns, which should have all floats in it.  So, I have two fields name 'Price' and 'Score'.  When I look at the data, it all looks like floats to me, but apparently something is a string.  Is there some way to kick out these things that are strings, but look like floats?  Or, is there a way to force everything to be float?  The error occurs on the last line show here, and then nothing else works.</p>
  
  <pre><code>df = pd.read_csv('C:\\my_path\\analytics.csv')
  print('done!')
  modDF = df[['Price', 'Score']].copy()
  modDF = modDF[:100]
  for i_dataset, dataset in enumerate(datasets):
      X, y = dataset
      # normalize dataset for easier parameter selection
      X = StandardScaler().fit_transform(X)
  </code></pre>
  
  <p>Here is the Stack Trace:</p>
  
  <pre><code>datasets = [modDF]
  for i_dataset, dataset in enumerate(datasets):
      X, y = dataset
      # normalize dataset for easier parameter selection
      X = StandardScaler().fit_transform(X)
  
  
  Traceback (most recent call last):
  
    File "&lt;ipython-input-18-013c2a6bef49&gt;", line 5, in &lt;module&gt;
      X = StandardScaler().fit_transform(X)
  
    File "C:\Users\rs\AppData\Local\Continuum\anaconda3\lib\site-packages\sklearn\base.py", line 553, in fit_transform
      return self.fit(X, **fit_params).transform(X)
  
    File "C:\Users\rs\AppData\Local\Continuum\anaconda3\lib\site-packages\sklearn\preprocessing\data.py", line 639, in fit
      return self.partial_fit(X, y)
  
    File "C:\Users\rs\AppData\Local\Continuum\anaconda3\lib\site-packages\sklearn\preprocessing\data.py", line 663, in partial_fit
      force_all_finite='allow-nan')
  
    File "C:\Users\rs\AppData\Local\Continuum\anaconda3\lib\site-packages\sklearn\utils\validation.py", line 496, in check_array
      array = np.asarray(array, dtype=dtype, order=order)
  
    File "C:\Users\rs\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\core\numeric.py", line 538, in asarray
      return array(a, dtype, copy=False, order=order)
  
  ValueError: could not convert string to float: 'Price'
  </code></pre>