Pandas delete all rows that are not a 'datetime' type
<p>I've got a large file with login information for a list of users. The problem is that the file includes other information in the <code>Date</code> column. I would like to remove all rows that are not of type <code>datetime</code> in the <code>Date</code> column. My data resembles</p>
<p><code>df</code>:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>Name</th>
<th>Date</th>
</tr>
</thead>
<tbody>
<tr>
<td>name_1</td>
<td>2012-07-12 22:20:00</td>
</tr>
<tr>
<td>name_1</td>
<td>2012-07-16 22:19:00</td>
</tr>
<tr>
<td>name_1</td>
<td>2013-12-16 17:50:00</td>
</tr>
<tr>
<td>name_1</td>
<td>4345 # type = 'int'</td>
</tr>
<tr>
<td>...</td>
<td># type = 'float'</td>
</tr>
<tr>
<td>name_2</td>
<td>2010-01-11 19:54:00</td>
</tr>
<tr>
<td>name_2</td>
<td>2010-02-06 12:10:00</td>
</tr>
<tr>
<td>...</td>
<td></td>
</tr>
<tr>
<td>name_2</td>
<td>2012-07-18 22:12:00</td>
</tr>
<tr>
<td>name_2</td>
<td>4521</td>
</tr>
<tr>
<td>...</td>
<td></td>
</tr>
<tr>
<td>name_5423</td>
<td>2013-11-23 10:21:00</td>
</tr>
<tr>
<td>...</td>
<td></td>
</tr>
<tr>
<td>name_5423</td>
<td>7532</td>
</tr>
</tbody>
</table>
</div>
<p>I've tried modifying the solution to</p>
<p><a href="https://stackoverflow.com/questions/21771133/finding-non-numeric-rows-in-dataframe-in-pandas">Finding non-numeric rows in dataframe in pandas?</a></p>
<p><a href="https://stackoverflow.com/questions/26771471/remove-rows-where-column-value-type-is-string-pandas">Remove rows where column value type is string Pandas</a></p>
<p>and <a href="https://www.quora.com/How-should-I-delete-rows-from-a-DataFrame-in-Python-Pandas" rel="nofollow noreferrer">How-should-I-delete-rows-from-a-DataFrame-in-Python-Pandas</a></p>
<p>to fit my needs.</p>
<p>The problem is that whenever I attempt the change I either get an error or the entire dataframe gets deleted</p>