重塑 numpy ndarray 时出现以下错误
DeprecationWarning: :func:`reshape` is deprecated, use :func:`numerix.reshape()<numpy.reshape>` instead!
return reshape(newshape, order=order)
Traceback (most recent call last):
File "./render2.py", line 374, in <module>
,u=np.reshape(voltage.grad[0], (ny, nx))
File "/home/jana/Builds/lib/python2.6/site-packages/numpy/core/fromnumeric.py", line 172, in reshape
return reshape(newshape, order=order)
File "/home/jana/Builds/lib/python2.6/site-packages/fipy/tools/decorators.py", line 151, in newfunc
return func(*args, **kwds)
TypeError: reshape() got an unexpected keyword argument 'order'
以下是给出此错误的代码部分。注意:plot.py 是用户定义的模块。
plot.streamlinePlot(x = x
,y = y
,u=np.reshape(voltage.grad[0], (ny, nx))
,v=np.reshape(voltage.grad[1], (ny, nx))
,filename='Analysis/electricFieldStreamPlot_%s.png'
,show=False
,clear=True)
的输出
print "Voltage shape =", voltage.shape
print "Voltage.grad[0] shape =", voltage.grad[0].shape
print "ny times nx =", ny*nx
是
Voltage shape = (269700,)
Voltage.grad[0] shape = (269700,)
ny times nx = 269700
我正在运行 FiPy 3.0 和 NumPy 1.7.2。有什么线索吗?谢谢!