當前位置:
首頁 >
成功解决TypeError: slice indices must be integers or None or have an __index__ method
發(fā)布時間:2025/3/21
37
豆豆
生活随笔
收集整理的這篇文章主要介紹了
成功解决TypeError: slice indices must be integers or None or have an __index__ method
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
成功解決TypeError: slice indices must be integers or None or have an __index__ method
?
目錄
解決問題
解決思路
解決方法
?
?
解決問題
TypeError: slice indices must be integers or None or have an __index__ method
?
?
解決思路
類型錯誤:切片索引必須是整數(shù)或無,或者有一個__index__ 的方法
?
?
解決方法
對要切分的數(shù)值,進行整數(shù)轉(zhuǎn)換
比如,
num
改為
int(num)
哈哈,大功告成!
?
?
?
總結(jié)
以上是生活随笔為你收集整理的成功解决TypeError: slice indices must be integers or None or have an __index__ method的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: DL之DNN:利用MultiLayerN
- 下一篇: DL之DNN:自定义MultiLayer