I am new to Pandas. I have the following pandas dataframe which contains the following values :
index print_statement timestamp
0 echo "I AM HAPPY2" 2018-11-12 08:01:00
1 echo "I AM HAPPY3" 2018-11-12 08:01:00
2 echo "I AM HAPPY1" 2018-11-12 08:01:00
3 echo "I AM HAPPY4" 2018-12-12 08:02:00
4 echo "I AM HAPPY5" 2018-12-13 08:02:00
I want to compare the df as:
- let's say I have a time_argument which is datetime.datetime(2018, 12, 12, 5, 1)
. I want to store the result in another dataframe
where timestamp > time_argument.
I tried using the following approach:
for index, row in df.iterrows():
date_store = row['time_to_expire']
if date_store.to_pydatetime() >= ii:
df_final = row
But I am not getting the desired answer.
Hope I am clear with the question.