'how to check the time using if statement and for loop for my dataframe

here is my statement in jupyter notebook ##check time frame to fill shift feature

 t2=dfOriginal['From']
time1=np.datetime64('1900-01-01T07:00:00')
time2=np.datetime64('1900-01-01T15:00:00')
time3=np.datetime64('1900-01-01T23:00:00')
for index in dfOriginal.iterrows():{
    if(t2>=time1 & t2 <time2):
    }

example of what i have in From column '1900-01-01T07:00:00' From data type is datetime64[ns]

i get this error

 File "<ipython-input-64-2685fa7977d0>", line 7
 if(t2>=time1 & t2 <time2):
 SyntaxError: invalid syntax


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source