pandas rearrange rows based on datetime index

Solutions on MaxInterview for pandas rearrange rows based on datetime index by the best coders in the world

showing results for - "pandas rearrange rows based on datetime index"
Liberty
22 Feb 2020
1split_date = pd.datetime(2014,2,2)df_train = df.loc[df[‘day_time’] < split_date]df_test = df.loc[df[‘day_time’] >= split_date]