This is just a curiosity question really. My code works. I have a large array of instances that I'm attempting to break into different groups (training, validation, and testing). They're represented in a single list, but it is important that they stay in groups of 23. Here's my implementation:
train_end = int(len(instances)*TRAINING_END)
while train_end % CHANNELS != 0:
train_end -= 1
valid_end = int(len(instances)*VALIDATION_END)
while valid_end % CHANNELS != 0:
valid_end += 1
And then I partition the lists using [:train_end], [train_end:valid_end], [valid_end:]
. I feel like everything that takes this many steps in python has a simpler way. Any ideas?