赞
踩
在python中,列表索引必须是integer,不能是float类型,包括numpy.float64比如
- l = [1,2,3,4]
- l[1.0]
这样是不行的,会报错
- Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- TypeError: list indices must be integers or slices, not float
如果用numpy.float64会报如下错误
- Traceback (most recent call last):
- File "c:\Users\threads.py", line 314, in run
- execute_task()
- File "c:\Users\daily.py", line 379, in istka_stable_filter15
- partual_data = self.stka_data[start: end]
- TypeError: slice indices must be integers or None or have an __index__ method
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。