title: python - cannot make corr work
body: <p>I'm struggling with getting a simple correlation done. I've tried all that was suggested under similar questions.</p>
  
  <p>Here are the relevant parts of the code, the various attempts I've made and their results. </p>
  
  <pre><code>import numpy as np
  import pandas as pd
  
  try01 = data[['ESA Index_close_px', 'CCMP Index_close_px' ]].corr(method='pearson')
  
  print (try01) 
  </code></pre>
  
  <p>Out:</p>
  
  <pre><code>Empty DataFrame
  Columns: []
  Index: []
  </code></pre>
  
  <hr>
  
  <pre><code>try04 = data['ESA Index_close_px'][5:50].corr(data['CCMP Index_close_px'][5:50])
  print (try04)
  </code></pre>
  
  <p>Out:</p>
  
  <pre><code>**AttributeError: 'float' object has no attribute 'sqrt'**
  </code></pre>
  
  <hr>
  
  <h2>using numpy</h2>
  
  <pre><code>try05 = np.corrcoef(data['ESA Index_close_px'],data['CCMP Index_close_px'])
  print (try05)
  </code></pre>
  
  <p>Out:</p>
  
  <pre><code>AttributeError: 'float' object has no attribute 'sqrt'
  </code></pre>
  
  <hr>
  
  <h2>converting the columns to lists</h2>
  
  <pre><code>ESA_Index_close_px_list = list()
  start_value = 1
  end_value = len (data['ESA Index_close_px']) +1
  for items in data['ESA Index_close_px']:
      ESA_Index_close_px_list.append(items)
      start_value = start_value+1    
      if start_value == end_value:
          break
      else:
          continue
  
  CCMP_Index_close_px_list = list()
  start_value = 1
  end_value = len (data['CCMP Index_close_px']) +1
  for items in data['CCMP Index_close_px']:
      CCMP_Index_close_px_list.append(items)
      start_value = start_value+1    
      if start_value == end_value:
          break
      else:
          continue
  
  try06 = np.corrcoef(['ESA_Index_close_px_list','CCMP_Index_close_px_list'])
  print (try06)
  </code></pre>
  
  <p>Out:</p>
  
  <pre><code>****TypeError: cannot perform reduce with flexible type****
  </code></pre>
  
  <hr>
  
  <p>Also tried .astype but not made any difference.</p>
  
  <pre><code>data['ESA Index_close_px'].astype(float)
  
  data['CCMP Index_close_px'].astype(float)
  </code></pre>
  
  <p>Using Python 3.5, pandas 0.18.1 and numpy 1.11.1</p>
  
  <p>Would really appreciate any suggestion.</p>
  
  <p>**edit1:*
  Data is coming from an excel spreadsheet
  <code>data = pd.read_excel('C:\\Users\\Ako\\Desktop\\ako_files\\for_corr_‌​tool.xlsx')</code>  prior to the correlation attempts, there are only column renames and </p>
  
  <pre><code>data = data.drop(data.index[0]) 
  </code></pre>
  
  <p>to get rid of a line</p>
  
  <p>regarding the types:</p>
  
  <pre><code>print (type (data['ESA Index_close_px']))
  
  
  
  print (type (data['ESA Index_close_px'][1]))
  </code></pre>
  
  <p>Out:
  
  </p>
  
  <p>**edit2*
  parts of the data:</p>
  
  <pre><code>print (data['ESA Index_close_px'][1:10])
  
  print (data['CCMP Index_close_px'][1:10])
  </code></pre>
  
  <p>Out:</p>
  
  <pre><code>2        2137
  3        2138
  4        2132
  5        2123
  6        2127
  7     2126.25
  8      2131.5
  9      2134.5
  10       2159
  Name: ESA Index_close_px, dtype: object
  2     5241.83
  3     5246.41
  4     5243.84
  5     5199.82
  6     5214.16
  7     5213.33
  8     5239.02
  9     5246.79
  10    5328.67
  Name: CCMP Index_close_px, dtype: object
  </code></pre>