slice indices must be integers or None or have an __index__ method

slice indices must be integers or None or have an __index__ method_第1张图片
原代码

x_train = x[0:train_data_rate * n]#切片

原因:切片是对应的是浮点数

你可能感兴趣的:(slice indices must be integers or None or have an __index__ method)