for row in data['column_name']: if row.date() < datetime.today().date(): print(row,????)
I was not able to get the index of a datatime of a specific column in a dataframe. I used this code and i want to return with the row the index of the row. Could anyone help me please?
Advertisement
Answer
You can try with something as follows
df.index[df['column_name'].dt.date < pd.Timestamp('now').date()].tolist()