python 基础
念念不忘,必有回想
这个作者很懒,什么都没留下…
展开
-
object is not callable
#用函数list = [12,24,35,70,88,120,155]lst = list(filter(lambda x: x%35 !=0, list))print(lst)TypeError Traceback (most recent call last)<ipython-input-1-48ff6ccffe27> in <module> 2 list = [12,24,35,70.原创 2021-04-06 11:44:19 · 1423 阅读 · 0 评论 -
python TypeError:‘int‘ object is not callable
python 练习时遇到此问题TypeError: 'int' object is not callable代码段为tup = (1,2,3,4,5,6,7,8,9,10)len = len(tup)print(len/2)# print(tup[:len/2])# print(tup[len/2:])错误原因:代码调用了不能被调用的对象或者变量。即(说人话), 变量名和函数名重合了。使得调用函数的时候,系统会认为这是在调用变量。...原创 2021-02-19 10:46:56 · 170 阅读 · 0 评论 -
invalid literal for int() with base 10
x,y = map(int,input().split(','))list = []for i in range(x): tem = [] for j in range(y): tem.append(i * j) list.append(tem) print(list) 输入3,5报错ValueError: invalid literal for int() with base 10: '3,5'错误原因 猝不及防.原创 2021-02-07 20:33:08 · 800 阅读 · 0 评论 -
python 中 pandas 忽略警告错误
pandas 的忽略警告行为pd.option.mode.chained_assignment = None而上一篇的import warnings 则是针对全文的警告import warningswarnings.filterwarnings('ignore')原创 2020-08-01 09:26:32 · 9193 阅读 · 4 评论