python的ValueError: only 2 non-keyword arguments accepted
小虎输入下面代码就出问题了,原因是因为没有把矩阵建立格式分清楚。在矩阵组外,加上方框即可,详细见下。
源代码
import time
import numpy as np
A = np.array([56.0, 0.0, 4.4, 68.0],
[1.2, 104.0, 52.0, 8.0],
[1.8, 135.0, 99.0, 0.9])
cal=A.sum(axis=0)
print(cal)
修改后
import time
import numpy as np
A = np.array([[56.0, 0.0, 4.4, 68.0],
[1.2, 104.0, 52.0, 8.0],
[1.8, 135.0, 99.0, 0.9]])
cal=A.sum(axis=0)
print(cal)
参考资料
how to resolve this ValueError: only 2 non-keyword arguments accepted sklearn python