I am trying to use the between_time
function. I have formatted the string type time to datetime
dataset['TimeStamp'] = pd.to_datetime(dataset['TimeStamp'],format)
and I defined search start time and end time:
start = datetime.time(9,40,0)
end = datetime.time(10,00,0)
then I call dataset['TimeStamp'].between_time(start, end)
This is the error I get:
TypeError: Index must be DatetimeIndex
Please how can I fix it. Thank you
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…