title: how to append a list to pandas data frame as new row
body: <p>I'm trying to create a <a href="https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html" rel="nofollow noreferrer"><code>pandas.DataFrame</code></a> to record every transaction record.</p>
  
  <p>Here is what I have created:</p>
  
  <pre><code>def create_blotter():
      blotter = []
      return blotter
  
  def create_blotter_columns():
      columns = ['Buy|Sell', 'Ticker', 'Volume', 'PricePerShare', 'Timestamp', 'TotalCosts']
      return columns
  
  
  class Ledger:
  
      _blotter = create_blotter()
      _blotter_columns = create_blotter_columns()
  
      def update_blotter(self, side, ticker, quantity, price, timestamp, transaction):
      columns = self._blotter_columns
      line = [side, ticker, quantity, price, timestamp, transaction]
      self._blotter.append(line)
      self._blotter = pd.DataFrame(self._blotter, columns=columns)
      self._blotter.sort_index(ascending=False)
      return self._blotter
  </code></pre>
  
  <p>The reason I did that way was that when I created both blotter and columns as follows, it would return tuples, thus I am unable to add new lines of lists to that.</p>
  
  <pre><code>def create_blotter_frame():
      blotter = []
      columns = ['Buy|Sell', 'Ticker', 'Volume', 'PricePerShare', 'Timestamp', 'TotalCosts']
      return blotter, columns
  </code></pre>
  
  <p>Anyway,so the first code works the first time, but it returns with error message:</p>
  
  <blockquote>
  <pre><code>RuntimeWarning: '&lt;' not supported between instances of 'str' and 'int', sort order is undefined for incomparable objects
    result = result.union(other)
  </code></pre>
  </blockquote>
  
  <p>I can't understand how it works the first time, and the second time it returns such error. The list is supposed to be capable of any types of data.</p>
  
  <p>My goal is to log all transaction records and aggregate them as <code>line</code> and append it to the <code>blotter</code> and display every record of transactions in the end.</p>
  
  <p>The sample data is like this:</p>
  
  <pre><code>side = 'Buy'
  ticker = 'AAPL'
  quantity = 100
  price = 100
  timestamp = "2018-02-27 23:12:50"
  transaction = 100000
  </code></pre>
  
  <p>And every transaction will create new values with timestamp.</p>