numpy
はpython3
の数学プロジェクトに使用しています。今日、私はnumpy.integrate.quad
を使用したかったのですが、あなたはエラーを見て、さらに以下を試してみることができます。 import numpy
は常に動作します。だから何が問題なの?python3:numpyは動作しますが、numpy.integrateはありません
$ python
Python 3.6.1 (default, Mar 27 2017, 00:27:06)
[GCC 6.3.1 20170306] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> import numpy.integrate as integrate
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'numpy.integrate'
>>> import scipy.integrate as integrate
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'scipy'
>>> from numpy import integrate
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'integrate'
>>> from scipy import integrate
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'scipy'
>>> from numpy.integrate import quad
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'numpy.integrate'
>>> from numpy import integrate.quad
File "<stdin>", line 1
from numpy import integrate.quad
Numpyは正しくインストールされているようですが、numpy.integrateはまだ使用できません。私は輸入品をばかげていますか?
「numpy.integrate.quad」はありません。リンクしたドキュメントに記載されている名前をもう一度見てください。 – user2357112
私はそこに「scipy.integrate.quad」と記載されていることを知っています。しかし、あなたが見ることができるように、 'numpy'の代わりに' scipy'を使うことはどちらもうまくいきません。あなたのコメントは建設的なものではありません。私が間違っていることを明記してください。 – LukeLR
scipyをインストールします。 – user2357112