train_indices = np.random.choice(35444, 24500, replace=False)
writer.writerows(data[train_indices])
TypeError: only integer scalar arrays can be converted to a scalar index错误。
train_indices = np.random.choice(35444, 24500, replace=False)
writer.writerows(np.array(data)[train_indices])