TypeError :
TypeError: Ridge.__init__() got an unexpected keyword argument 'normalize'
处理方法:
在这个例子中,我们只需要将没有用的normalize参数删除,就可以避免出现TypeError: Ridge.__init__() got an unexpected keyword argument 'normalize'错误了。
AssertionError: Wrong output.
断句错误:按提示修改对应的地方即可。
IndentationError:
缩进错误。
UnboundLocalError:
UnboundLocalError: cannot access local variable 'XXX' where it is not associated with a value
解决办法:1. 声明函数中的内部变量 XXX为全局变量,用global XXX。2. 在函数中将变量 dj_dw_ij重新初始化。
NameError:
NameError: name 'XXX' is not defined
一般就是XXX输入错误,好好检查一下。
TypeError:
TypeError: Cannot interpret '1' as a data type
Defaulting to user installation because normal site-packages is not writeable
解决办法:将pip改为pip3 install --user XX