python中list进行加减乘除运算报错:TypeError: unsupported operand type(s) for -: ‘int’ and ‘list’ TypeError: unsupported operand type(s) for -: ‘int’ and ‘list’ 解决方法 使用np.array进行type转换 import numpy as np y_true = [[0.], [1.]] 1-np.array(y_true) 以上就是全部内容