title: Error in pandas while subtracting two values and storing them again
body: <pre><code>First.csv
  LAC Reference_Count
  1000    500
  2222    1000
  3333    500
  5555    1000
  9999    1500
  
  Second.csv
  LAC 10/08/15 00:00  10/08/15 01:00
  1000    2000    2500
  2222    3000    4000
  </code></pre>
  
  <p>I have two files first.csv and second.csv,in first.csv I have two headers LAC and reference count,second.csv no of header can be in any number but it will follow one format that is one column with LAC all ids, followed by time date series,I need to take LAC(id) from second.csv and search in LAC of first.csv take the reference count and subtract value of all time series of second.csv. You can better understand with expected output.</p>
  
  <pre><code>second.csv 
      LAC  10/08/15 00:00  10/08/15 01:00
  0  1000            1500            2000
  1  2222            2000            3000
  </code></pre>
  
  <p>Here is my code </p>
  
  <pre><code>import pandas as pd
  location='/home/saiharsh/Documents/Crowd Street/BUgs/second.py.csv'
  master_lac_path='/home/saiharsh/Documents/Crowd Street/Final/first.csv'
  master_csv_file = master_lac_path
  df_master=pd.read_csv(master_csv_file,error_bad_lines=False)
  df2=pd.read_csv(location,error_bad_lines=False)
  header=list(df2.iloc[:,1:].columns.values)
  print df2
  for i in range(len(df2)):
              val=df_master[df_master['LAC']==df2['LAC'][i]]['Reference_Count']
              for j in header:
                  Tmp=df2[j][i]
                  tmp=df2[df2[j]==Tmp][j]
                  value=tmp-val
                  print type(tmp),type(val),type(value)
                  df2.set_value(i,j,value)
  print df2
  </code></pre>
  
  <p>I am getting this error</p>
  
  <pre><code>Traceback (most recent call last):
    File "/home/Py_Process_Plots/master_lac.py", line 14, in process
      value=tmp-val
    File "/home/software/anaconda/lib/python2.7/site-packages/pandas/core/ops.py", line 524, in wrapper
      arr = na_op(lvalues, rvalues)
    File "/home/software/anaconda/lib/python2.7/site-packages/pandas/core/ops.py", line 475, in na_op
      result[mask] = op(x[mask], _values_from_object(y[mask]))
  TypeError: unsupported operand type(s) for -: 'str' and 'float'
  </code></pre>
  
  <p>My pandas version is 0.16.2 and numpy is 1.9.2 </p>
  
  <p>Please help me to solve the problem.</p>