filter out the oldest date for a specific value in a CSV file


filter out the oldest date for a specific value in a CSV file




<html>
<head>
<style>
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}

td, th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}

tr:nth-child(even) {
background-color: #dddddd;
}
</style>
</head>
<body>


<table>
<tr>
<th>Item Name</th>
<th>Created Date</th>
<th>Other column(s)</th>
</tr>
<tr>
<td>Item A</td>
<td>6/28/2018 20:08</td>
<td>not related stuff</td>
</tr>
<tr>
<td>Item A</td>
<td style="background-color:lightblue">6/28/2018 12:08</td>
<td>not related stuff</td>
</tr>
<tr>
<td>Item A</td>
<td>6/28/2018 21:08</td>
<td>not related stuff</td>
</tr>
<tr>
<td>Item B</td>
<td>6/28/2018 14:08</td>
<td>not related stuff</td>
</tr>
<tr>
<td>Item B</td>
<td>6/28/2018 23:08</td>
<td>not related stuff</td>
</tr>
<tr>
<td>Item B</td>
<td style="background-color:lightblue">6/28/2018 09:08</td>
<td>not related stuff</td>
</tr>
</table>



I have a CSV file that has the data in above format. It's sorted by the item name. For each same item name, i'd like to filter out the row that has the oldest created date(see blue high-lighted ones) and keep the remaining non-oldest rows. How can i do this with Python pandas? or can this done by Excel alone?
thank you so much





That isn't a CSV at all, it's HTML.
– roganjosh
39 secs ago





@roganjosh admit it, they almost had you :)
– Joel Berkeley
7 secs ago









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

paramiko-expect timeout is happening after executing the command

how to run turtle graphics in Colaboratory

Export result set on Dbeaver to CSV