slice indices must be integers or None or have an index method
剛開始的寫法
cleaned_data = cleaned_data[0:len(cleaned_data)*0.9]
錯(cuò)誤原因是浮點(diǎn)數(shù)不能當(dāng)數(shù)組或者元組的下標(biāo)
正確寫法,轉(zhuǎn)成int就可以了,試過用round替換int但是也沒起作用
cleaned_data = cleaned_data[0:int(len(cleaned_data)*0.9)]