我在Python 2.7中运行以下代码
import numpy
a = numpy.ndarray(shape=(2,2), dtype=float, order='F')
print numpy.mean(a)
numpy.savetext('foo.txt', a)
Run Code Online (Sandbox Code Playgroud)
并得到这个结果
[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'
Run Code Online (Sandbox Code Playgroud)
怎么了?