Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/344.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python NumPy:TypeError:reformate()获取了意外的关键字参数';订单';_Python_Numpy_Fipy - Fatal编程技术网

Python NumPy:TypeError:reformate()获取了意外的关键字参数';订单';

Python NumPy:TypeError:reformate()获取了意外的关键字参数';订单';,python,numpy,fipy,Python,Numpy,Fipy,我在重塑numpy数组时遇到以下错误 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>

我在重塑numpy数组时遇到以下错误

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'
产量

print "Voltage shape =", voltage.shape
print "Voltage.grad[0] shape =", voltage.grad[0].shape
print "ny times nx =", ny*nx 

我正在运行FiPy 3.0和NumPy 1.7.2。
有什么线索吗?谢谢

您应该通过调用

from fipy import numerix as nx
nx.reshape(voltage.grad[0], (ny, nx))
FiPy重写了许多NumPy例程,以便以自一致的方式使用自己的数据结构。使用fipy对象时,应始终使用fipy.numerix而不是numpy

如果您不知道,FiPY现在包含了一个可以满足您的需要,或者至少向您显示您需要为自己的显示执行的数据操作


numpy.reforme()、fipy.numerix.reforme()和fipy.CellVariable.reforme()之间的交互肯定有问题。我已经立案调查此事。谢谢你提出这个问题。

请发布你正在运行的代码(足以重现错误)以及numpy和FipyThank@MattDMo的版本。我已经编辑了我的帖子。这可能是fipy中的一个bug。你能在不导入fipy的情况下运行
np.restrape(voltage.grad[0],(ny,nx)
吗?您好,谢谢您的回答。但是,我得到了错误:
u=nx.restrape(voltage.grad[0],(ny,nx))AttributeError:'int'对象没有属性“restrape”
u=nx.restrape(voltage.grad[…,0],(ny,nx))。维度需要是最后一个索引,而不是第一个索引。
Voltage shape = (269700,)
Voltage.grad[0] shape = (269700,)
ny times nx = 269700
from fipy import numerix as nx
nx.reshape(voltage.grad[0], (ny, nx))