出现TypeError: 'int' object is not callable 问一下大家如何解决

问题遇到的现象和发生背景
问题相关代码,请勿粘贴截图
# Decompose into wavelet components, to the level selected:
    ffs = pywt.wavedec(data, 'db8', level=maxlev)  # 将信号进行小波分解
    zbs = []
    plt.figure()
    for i in range(1, len(ffs)):
        zbs[i] = pywt.threshold(ffs[i], threshold * max(ffs[i]))  # 将噪声滤波

    datarec = pywt.waverec(zbs, 'db8')  # 将信号进行小波重构

Traceback (most recent call last):
maximum level is 5
File "C:/Users/Desktop/1.py", line 59, in
zbs[i] = pywt.threshold(ffs[i], threshold * max(ffs[i])) # 将噪声滤波
TypeError: 'int' object is not callable

运行结果及报错内容
我的解答思路和尝试过的方法
我想要达到的结果

你检查下前面的代码是不是把max作为变量名赋值成数值了
用print(type(max)) 看看是不是int类型
max是内置函数,不要作为变量名使用

如有帮助,请点击我的回答下方的【采纳该答案】按钮帮忙采纳下,谢谢!

img

ffs[i]是int,导致函数pywt.threshold()报错。
可以用help(pywt.threshold) 查看一下函数用法

ffs[i]里面应该放image,而不是int
你确定不是应该处理ffs ,而要处理它的每一个元素吗

您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!
PS:问答VIP年卡 【限时加赠:IT技术图书免费领】,了解详情>>> https://vip.csdn.net/askvip?utm_source=1146287632