Trying to break up a dataframe into train, val, and test dataframes based on its row index e.g. observation 1 will go into training, 2 into val, and 3 into test, however, I'm hitting a roadblock. Here's my code thus far:
climbingTngDataset = pd.DataFrame([])
climbingValDataset = pd.DataFrame([])
climbingTestDataset = pd.DataFrame([])
for i in range(len(dfClimbing)):
if i % 2 == 0:
climbingValDataset.append(i)
if i % 3 == 0:
climbingTestDataset.append(i)
else:
climbingTngDataset.append(i)