title: Loop Though List of Lists Python and Merge Entries
body: <p>I'm in the middle of cleaning up some data in Python. I get a load of lists with 6 entries which I eventually want to put into a dataframe, however before doing that I'd like to loop through and check if entry 1 in the list is the only non-empty string in the list. For instance I have a list called <code>transaction_list</code>:</p>
  <pre><code>transaction_list = [
      ['01Oct', 'CMS ACC TRF /MISC CREDIT, AG', '', '', '5,000.00', '11,377.00'],
      ['', 'MULTI RESOURCES LIMITED,', '', '', '', ''],
      ['', 'CMS19274001077, 1094175DAAA107', '', '', '', ''],
      ['01Oct', 'INTER ACC CREDIT, SY', '', '', '1,000.00', '12,732.07'],
      ['', 'WTA CO3 (MAUR) LIMITED,', '', '', '', ''],
      ['', 'CMS19274009397, 729981UAAA298', '', '', '', ''],
      ['01Oct', 'HOUSE CHEQUE PRESENTED, , 639584,', '639584', '400.00', '', '12,332.07'],
      ['01Oct', 'CHEQUE PROCESSING FEE, , ,', '', '0.50', '', '12,331.57']
  ]
  </code></pre>
  <p>I basically need to loop through and store a list in memory, however if the list only has the first entry populated and the other entries are empty strings, I want to merge that entry via a line break with the previous first entry of the loop and then delete that list. So the final should look something like this:</p>
  <pre><code>transaction_list = [
      ['01Oct', 'CMS ACC TRF /MISC CREDIT, AG \n MULTI RESOURCES LIMITED \n CMS19274001077, 1094175DAAA107',
          '', '', '5,000.00', '11,377.00'],
      ['01Oct', 'INTER ACC CREDIT, SY \n WTA CO3 (MAUR) LIMITED \n CMS19274009397, 729981UAAA298',
       '', '', '1,000.00', '12,732.07'],
      ['01Oct', 'HOUSE CHEQUE PRESENTED, , 639584,',
          '639584', '400.00', '', '12,332.07'],
      ['01Oct', 'CHEQUE PROCESSING FEE, , ,', '', '0.50', '', '12,331.57']
  ]
  </code></pre>
  <p>I've been cracking my head all night on this with no luck.</p>