title: Python - TypeError: Tuple indices must be integers or slices, not numpy.float64
body: <p>Getting this error for something that looks simple. Help would be appreciated.</p>
  
  <p>finaltbl is a pandas df with col1prelim, col2prelim, and col3prelim, which have values ranging between 0 and 1 in float format.</p>
  
  <pre><code>finaltbl['col1'] = np.nan
  finaltbl['col2'] = np.nan
  finaltbl['col3'] = np.nan
  coldict = {'col1':'col1prelim', 'col2':'col2prelim', 'col3':'col3prelim'}
  
  for k, v in coldict.items():
      finaltbl.at[0, k] = 1
      finaltbl.at[1, k] = np.mean(finaltbl.loc[0, v], finaltbl.loc[1, v])
  </code></pre>
  
  <p>This returns <code>TypeError: tuple indices must be integers or slices, not numpy.float64</code></p>
  
  <p>However this works:</p>
  
  <pre><code>for k, v in coldict.items():
      finaltbl.at[0, k] = 1
      finaltbl.at[1, k] = (finaltbl.loc[0, v] + finaltbl.loc[1, v])/2
  </code></pre>
  
  <p>How do I change my average/mean calc above to work? I need to later on use 3 or 4 inputs rather than 2 and would like to be able to use a mean formula or something similar.</p>