title: Add value in dataframe using for loop
body: <p>I am new to StackOverflow</p>
  
  <p>This is my second time asking a similar question because the first one was not clear and was duplicate. By the way, I am new and trying to learn web scraping.</p>
  
  <p>This is what I have done so far:</p>
  
  <p>I have a list of string where the first index is column name having next index as it's value. Similarly, the third index is the column name but with the different name having the fourth index is the value.</p>
  
  <p>I wanted to put all this list into the data frame having column name 'i' having the value 'i_next'</p>
  
  <pre><code>text=my_detail[0].split('\n')
  #for example text=['a','2','b','3',c,'4'] &lt;is a list not dataframe&gt;
  #some of the string in text is not require
  #example the text can be ['a','2','f','b','3','c','4']
  
  df = pd.DataFrame(columns=['a','b','c'])
  
  for i,nexti in zip(text,text[1:]):
  
      if i in df.columns:
          #store df at column name i having value nexti  
  '''
  The expected answer is
  a b c
  2 3 4
  '''
  </code></pre>
  
  <p>In case this question again got any problem or duplicate you can comment and I will delete it.</p>
  
  <p>Thank you for your consideration,</p>