问题描述
- TypeError: len() of unsized object
-
Traceback (most recent call last):
File "", line 1, in
File "E:Anaconda3libsite-packagesspyderlibwidgetsexternalshellsitecustomize.py", line 699, in runfile
execfile(filename, namespace)
File "E:Anaconda3libsite-packagesspyderlibwidgetsexternalshellsitecustomize.py", line 88, in execfile
exec(compile(open(filename, 'rb').read(), filename, 'exec'), namespace)
File "F:/05paper/graduation paper/Gmm/expertInstitution.py", line 27, in
main()
File "F:/05paper/graduation paper/Gmm/expertInstitution.py", line 23, in main
scholarInstition()
File "F:/05paper/graduation paper/Gmm/expertInstitution.py", line 17, in scholarInstition
if scholarData.iloc[j,0]==paperId.iloc[i]:
File "E:Anaconda3libsite-packagespandascoreops.py", line 739, in wrapper
if len(self) != len(other):
TypeError: len() of unsized object
解决方案
环境:python2.7
百度下,只有几个例子,有个说是某个函数被重新定义了,导致出问题。
我仔细看了下我的错误:
Traceback (most recent call last):
? File "/usr/local/lib/python2.7/dist-packages/eventlet-0.14.0-py2.7.egg/eventlet/hubs/hub.py", lin......
答案就在这里:TypeError: 'tuple' object is not callable
解决方案二:
你len访问的对象,它没有个数的概念。不能获取它的长度等。只有list等对象有len
时间: 2024-10-31 11:10:27