Keeping last 24 hours of log in pandas.DataFrame
<p>I need to keep a log of records (sensor data) in pandas.Dataframe, but I only need to keep last 24 hours of them. A new record arrives every second.</p>

<p>Records have format of:</p>

<p><code>{'Date': ..., 'Sensor1': 10, 'Sensor2': 12, ...}
</code></p>

<p>Where 'Date' should also be the index of the DataFrame.</p>

<p>Of course, it's possible to use:</p>

<p><code>df = df.append( newRecord )
df.drop( df[df.Date &lt; datetime.now() - timedelta( hours=24 )].index] )
</code>
But I feel it's ugly.</p>

<p>What is the most efficient and panda-ish way to do so?</p>