Pandas: Performance when converting date string to epoch time
<p>I have to parse several csv files with thousands of records and there is a column that represents a date. I am converting it to epoch time as follow:</p>

<p>CSV example:</p>

<pre><code>date
2010-07-08 21:24:52
2010-07-08 21:24:53
</code></pre>

<p>What I am doing now:</p>

<pre><code># First convert column to datetime
df.date = pd.to_datetime(df.date)

# Then to epoch time
df.date = pd.to_timedelta(df.date).astype('timedelta64[s]')
</code></pre>

<p>Because there is a LOT of records, it takes a while to do this conversion. So, the question is, is there a better way to implement this?</p>