Condition for datatime in a dataframe

How can I implement a condition for Picking Start Time and Picking End Time? I want to deduct .5 from the Picking Time if the Picking Start and Picking End is between 21:00 and 21:30.

|Picking Start Time |Picking End Time   |Picking Time|
|:------------------|:----------------  |:-----------|
|2021-08-17 20:52:09|2021-08-17 21:36:54|0.75        |

Answer

Considering the condition both start and end time should be between 21:00 and 21:30

import pandas as pd
import datetime

df = pd.DataFrame([['2021-08-17 20:52:09', '2021-08-17 21:36:54', 0.75], ['2021-08-17 21:00:09', '2021-08-17 21:25:54', 0.25]], columns=['Picking Start Time', 'Picking End Time', 'Picking Time'])

df['Picking Start Time'] = pd.to_datetime(df['Picking Start Time'])
df['Picking End Time'] = pd.to_datetime(df['Picking End Time'])

filter_ = (df['Picking Start Time'].dt.time <= datetime.time(21,0))
        & (df['Picking End Time'].dt.time >= datetime.time(21,30))

df.loc[filter_, 'Picking Time'] =df.loc[filter_, 'Picking Time'] - 0.5

print(df)

#    Picking Start Time    Picking End Time  Picking Time
# 0 2021-08-17 20:52:09 2021-08-17 21:36:54          0.25
# 1 2021-08-17 21:00:09 2021-08-17 21:25:54          0.25