title: How to specify the number of rows a pandas dataframe will have?
body: <p>I have a Pandas dataframe and I am continually appending a row of data each second as below. </p>
  
  <pre><code>df.loc[time.strftime("%Y-%m-%d %H:%M:%S")] = [reading1, reading2, reading3]
  &gt;&gt;&gt;df
                       sensor1 sensor2 sensor3
  2015-04-14 08:50:23    5.4     5.6     5.7
  2015-04-14 08:50:24    5.5     5.6     5.8
  2015-04-14 08:50:26    5.2     5.3     5.4
  </code></pre>
  
  <p>If I continue this, eventually I am going to start experiencing memory issues (Each time it will call the whole DataFrame).</p>
  
  <p>I only need to keep X rows of the data. i.e. after the operation, it will be:</p>
  
  <pre><code>&gt;&gt;&gt;df
                       sensor1 sensor2 sensor3
  (this row is gone)
  2015-04-14 08:50:24    5.5     5.6     5.8
  2015-04-14 08:50:26    5.2     5.3     5.4
  2015-04-14 08:50:27    5.2     5.4     5.6
  </code></pre>
  
  <p>Is there a way I can specify a maximum number of rows, so that when any subsequent rows are added, the oldest row is deleted at the same time WITHOUT a 
  "Check length of DataFrame, If length of DataFrame > X, Remove first row, Append new row"?</p>
  
  <p>Like this, but for a Pandas DataFrame: <a href="https://stackoverflow.com/a/10155753/4783578">https://stackoverflow.com/a/10155753/4783578</a></p>