这个非常简单的numpy脚本有什么问题?

时间:2014-05-13 19:59:29

标签: python numpy

我在Python 2.7中运行以下内容

import numpy
a = numpy.ndarray(shape=(2,2), dtype=float, order='F')
print numpy.mean(a)
numpy.savetext('foo.txt', a)

并获得此结果

[me@foo bar]$ python f.py 
8.79658981512e-317
Traceback (most recent call last):
  File "f.py", line 4, in <module>
    numpy.savetext('foo.txt', a)
AttributeError: 'module' object has no attribute 'savetext'

出了什么问题?

1 个答案:

答案 0 :(得分:13)

numpy.savetxt,没有e