試圖建立一個矩陣開始搜索算法。的Python:參數 - 4個參數允許,5給出
Traceback (most recent call last):
File "Fusion Puzzle Algorithm 2.py", line 20, in <module>
A = matrix([z11,z12,z13,z14], [z21,z22,z23,z24], [z31,z32,z33,z34], [z41,z42,z43,z44])
TypeError: __new__() takes at most 4 arguments (5 given)
我怎樣才能得到這個工作:
from numpy import *
z11 = vars()
z12 = vars()
z13 = vars()
z14 = vars()
z21 = vars()
z22 = vars()
z23 = vars()
z24 = vars()
z31 = vars()
z32 = vars()
z33 = vars()
z34 = vars()
z41 = vars()
z42 = vars()
z43 = vars()
z44 = vars()
A = matrix([z11,z12,z13,z14], [z21,z22,z23,z24], [z31,z32,z33,z34], [z41,z42,z43,z44])
當運行錯誤,它來了?
看什麼'matrix'預計其參數是:http://docs.scipy.org/doc/numpy/reference/generated/numpy.matrix.html – Blender