title: Push data to google sheet from dataframe
body: <p>I'm trying to push data into my google sheet with the following code, how can i change the code so that it will print in the 2nd row at the correct column base on the header that I've created.  </p>
  
  <p>First code:</p>
  
  <pre><code>class Header:
    def __init__(self):
      self.No_DOB_Y=1
      self.No_DOB_M=2
      self.No_DOB_D=3
      self.Paid_too_much_little=4
      self.No_number_of_ins=5
      self.No_gender=6
      self.No_first_login=7
      self.No_last_login=8
      self.Too_young_old=9
    def __repr__(self):
      return str(self.__dict__)
  
    def add_col(self,name):
      setattr(self,name,max(anomali_header.__dict__.values())+1)
  
  
  anomali_header=Header() 
  </code></pre>
  
  <p>2nd part of code (NEW):</p>
  
  <pre><code># No_gender
  a = list(df.loc[df['gender'].isnull()]['id'])
  #print(a)
  
  cells=sh3.range(1,1,len(a),1)
  for i,cell in enumerate(cells):
    cell.value=a[i]
  
  sh3.update_cells(cells)
  </code></pre>
  
  <p>At the moment it updates into A1 cell....</p>
  
  <p><a href="https://i.stack.imgur.com/O0hPr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/O0hPr.png" alt="enter image description here"></a></p>
  
  <p>This is what I essentially want to</p>
  
  <p><a href="https://i.stack.imgur.com/S44eU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/S44eU.png" alt="enter image description here"></a></p>
  
  <p>As you can see, the code writes the results onto the first available cell which is A1, i essentially want it to appear at the bottom of my anomali_header of "No_gender" but I'm not sure how to link my 1st part of the code to the 2nd part of the code...</p>
  
  <p>Thanks to v25, the code below works, but rather than going through the code one by one, i wanted to create a loop which goes through all the function</p>
  
  <p>I'm trying to run the code below, but it seems I get an error when I use the loop. </p>
  
  <p>Error:</p>
  
  <pre><code>TypeError: 'list' object cannot be interpreted as an integer
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code># No_DOB_Y
  a = list(df.loc[df['Year'].isnull()]['id'])
  
  # No number of ins
  b = list(df.loc[df['number of ins'].isnull()]['id'])
  
  # No_gender
  c = list(df.loc[df['gender'].isnull()]['id'])
  
  # Updating anomalies to sheet
   condition = [a,b,c]
   column = [1,2,3]
  
  for j in range(column,condition):
     cells=sh3.range(2,column,len(condition)+1,column)
     for i,cell in enumerate(cells):
       cell.value=condition[i]
  print('end of check')
  
  sh3.update_cells(cells)
  </code></pre>