I have a large dataframe that I am trying to edit. I am trying to simplify the timestamp column by removing the date and the seconds so the column only shows a four-digit time e.g. "00:00". So far all I know what to do is use a for loop but I have no clue what condition to apply to this problem
timestamp date activity Id total hour activity
720 2003-05-08 00:00:00 2003-05-08 0 condition_1 NaN
721 2003-05-08 00:01:00 2003-05-08 0 condition_1 NaN
722 2003-05-08 00:02:00 2003-05-08 0 condition_1 NaN
723 2003-05-08 00:03:00 2003-05-08 0 condition_1 NaN
724 2003-05-08 00:04:00 2003-05-08 0 condition_1 NaN
... ... ... ... ... ...
10794 2003-05-14 23:54:00 2003-05-14 0 condition_1 NaN
10795 2003-05-14 23:55:00 2003-05-14 12 condition_1 NaN
10796 2003-05-14 23:56:00 2003-05-14 0 condition_1 NaN
10797 2003-05-14 23:57:00 2003-05-14 18 condition_1 NaN
10798 2003-05-14 23:58:00 2003-05-14 0 condition_1 NaN
10079 rows × 5 columns
for i, row in df.iterrows():
if row['timestamp']:
#delete row