title: Python: data argument can't be an iterator
body: <p>I'm trying to replicate the code that is provided here:
  <a href="https://github.com/IdoZehori/Credit-Score/blob/master/Credit%20score.ipynb" rel="noreferrer">https://github.com/IdoZehori/Credit-Score/blob/master/Credit%20score.ipynb</a></p>
  
  <p>The function given below fails to run and give error. Can someone help me resolving it</p>
  
  <pre><code>def replaceOutlier(data, method = outlierVote, replace='median'):
  '''replace: median (auto)
              'minUpper' which is the upper bound of the outlier detection'''
  vote = outlierVote(data)
  x = pd.DataFrame(zip(data, vote), columns=['annual_income', 'outlier'])
  if replace == 'median':
      replace = x.debt.median()
  elif replace == 'minUpper':
      replace = min([val for (val, vote) in list(zip(data, vote)) if vote == True])
      if replace &lt; data.mean():
          return 'There are outliers lower than the sample mean'
  debtNew = []
  for i in range(x.shape[0]):
      if x.iloc[i][1] == True:
          debtNew.append(replace)
      else:
          debtNew.append(x.iloc[i][0])
  
  return debtNew
  </code></pre>
  
  <p>Function Call:</p>
  
  <pre><code>incomeNew = replaceOutlier(df.annual_income, replace='minUpper')
  </code></pre>
  
  <blockquote>
    <p>Error:
    x = pd.DataFrame(zip(data, vote), columns=['annual_income', 'outlier'])
    TypeError: data argument can't be an iterator</p>
  </blockquote>
  
  <p>PS: I understand this has been asked before, but I tried using the techniques however the error still remains</p>