title: Apply function on each row of a dataframe and increment a counter at the same time
body: <p>I know I can use <code>apply()</code> to apply a function on each row of a dataframe as below:</p>
  <pre><code>import pandas as pd
  df = pd.DataFrame({'Name' : ['A', 'B', 'C'], 'Number' : [1,2,3]})
  def func(row):
      pass
  df.apply(lambda x: func(x), axis =1 )
  
  </code></pre>
  <p>But I need to pass an incremental counter to <code>func()</code>. Something like below, but I don't know how to increment counter!</p>
  <pre><code>import pandas as pd
  df = pd.DataFrame({'Name' : ['A', 'B', 'C'], 'Number' : [1,2,3]})
  def func(row, counter):
      pass
  counter = 0 #initial value
  df.apply(lambda x: func(x, counter), axis =1 )
  
  </code></pre>