title: Function on each row of pandas DataFrame but not generating a new column
body: <p>I have a data frame in pandas as follows:</p>
  
  <pre><code>  A    B    C    D
    3    4    3    1
    5    2    2    2
    2    1    4    3
  </code></pre>
  
  <p>My final goal is to produce some constraints for an optimization problem using the information in each row of this data frame so I don't want to generate an output and add it to the data frame. The way that I have done that is as below:</p>
  
  <pre><code>def Computation(row):
  
      App = pd.Series(row['A'])
  
      App = App.tolist()
  
      PT = [row['B']] * len(App)
  
      CS = [row['C']] * len(App)
  
      DS = [row['D']] * len(App)
  
      File3 = tuplelist(zip(PT,CS,DS,App))
  
      return m.addConstr(quicksum(y[r,c,d,a] for r,c,d,a in File3) == 1)
  </code></pre>
  
  <p>But it does not work out by calling:</p>
  
  <pre><code>df.apply(Computation, axis = 1)
  </code></pre>
  
  <p>Could you please let me know if there is anyway to do this process?</p>