Answers for "boolean indexing datetime object | converting string to datetime object"

0

boolean indexing datetime object | converting string to datetime object

#convert col fromt string to dt 
df['date_time'] = pd.to_datetime(df['date_time'])

#boolean indexing on column 
day = i_94.copy()[(df['date_time'].dt.hour >= time_val) & (df['date_time'].dt.hour < time_val)]
print(day.shape)
Posted by: Guest on August-17-2021

Code answers related to "boolean indexing datetime object | converting string to datetime object"

Python Answers by Framework

Browse Popular Code Answers by Language