本方法为了训练数据平移滑动组合成新数据. 解决数据过长,训练不充分问题 def test(): """ :input: data :return: [12,123,1234,12345,123456,23,234,2345,23456,34,345,3456,45,456,56] """ for i in range(len(data)): for j in range(i+2, len(data) + 1): print(data[i:j])