Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas rearrange rows based on datetime index

split_date = pd.datetime(2014,2,2)df_train = df.loc[df[‘day_time’] < split_date]df_test = df.loc[df[‘day_time’] >= split_date]
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #pandas #rearrange #rows #based #datetime #index
ADD COMMENT
Topic
Name
1+9 =