AttributeError: 'module' object (scipy) has no attribute *** Why does this error occur?

Sibbs Gambling

In scipy, the error occurs quite often.

>>> import scipy
>>> scipy.integrate.trapz(gyroSeries, timeSeries)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'integrate'
>>> 

I figure out how to solve this problem by doing the following:

>>> 
>>> import scipy.integrate
>>> scipy.integrate.trapz(gyroSeries, timeSeries)
>>> 1.2

My question:

Why does the error occur?

Why would that fix the error?

Amit

Most possibly because scipy is a library (package) that contains modules and to import a specific module from the scipy library, you need to specify it and import the module itself. As it's a separate module (sub-package), once you import it, it's attributes are available to you by using the regular scipy.module.attribute

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

AttributeError: 'module' object(scipy)has no attribute 'misc'

分類Dev

AttributeError: 'module' object(scipy)has no attribute 'misc'

分類Dev

AttributeError: 'module' object has no attribute

分類Dev

Flask Blueprint AttributeError: 'module' object has no attribute 'name' error

分類Dev

AttributeError: 'module' object has no attribute 'computation'

分類Dev

AttributeError: 'module' object has no attribute 'reader'

分類Dev

AttributeError: 'module' object has no attribute 'urlretrieve'

分類Dev

Python AttributeError: 'module' object has no attribute 'suite'

分類Dev

AttributeError: 'module' object has no attribute 'hist'

分類Dev

Spark SQL - Select yields AttributeError: 'module' object has no attribute 'api'

分類Dev

numpy.getbuffer causes AttributeError: 'module' object has no attribute 'getbuffer'

分類Dev

Container Engine: AttributeError: 'module' object has no attribute 'Credentials'

分類Dev

Why am i getting AttributeError: 'KerasClassifier' object has no attribute 'model'?

分類Dev

AttributeError: 'function' object has no attribute

分類Dev

AttributeError: 'bool' object has no attribute

分類Dev

'module' object has no attribute 'SortedDict' Django Tastypie error

分類Dev

AttributeError: 'datetime' module has no attribute 'strptime'

分類Dev

theanoのインポート:AttributeError: 'module' object has no attribute 'find_graphviz'

分類Dev

pythonエラー「AttributeError: 'module' object has no attribute 'sha1'」

分類Dev

AttributeError: module 'win32ctypes.pywin32.win32api' has no attribute 'error'

分類Dev

SQLAlchemy "AttributeError: 'str' object has no attribute 'c'"

分類Dev

TensorFlow:AttributeError: 'Tensor' object has no attribute 'shape'

分類Dev

Scrapy:AttributeError: 'list' object has no attribute 'iteritems'

分類Dev

AttributeError: 'list' object has no attribute 'split'-Python

分類Dev

AttributeError( "'str' object has no attribute 'read'")

分類Dev

AttributeError: 'DeferredAttribute' object has no attribute '_meta'

分類Dev

AttributeError( "'str' object has no attribute 'read'")

分類Dev

AttributeError( "'str' object has no attribute 'read'")

分類Dev

AttributeError: 'Snackbar' object has no attribute 'show'

Related 関連記事

  1. 1

    AttributeError: 'module' object(scipy)has no attribute 'misc'

  2. 2

    AttributeError: 'module' object(scipy)has no attribute 'misc'

  3. 3

    AttributeError: 'module' object has no attribute

  4. 4

    Flask Blueprint AttributeError: 'module' object has no attribute 'name' error

  5. 5

    AttributeError: 'module' object has no attribute 'computation'

  6. 6

    AttributeError: 'module' object has no attribute 'reader'

  7. 7

    AttributeError: 'module' object has no attribute 'urlretrieve'

  8. 8

    Python AttributeError: 'module' object has no attribute 'suite'

  9. 9

    AttributeError: 'module' object has no attribute 'hist'

  10. 10

    Spark SQL - Select yields AttributeError: 'module' object has no attribute 'api'

  11. 11

    numpy.getbuffer causes AttributeError: 'module' object has no attribute 'getbuffer'

  12. 12

    Container Engine: AttributeError: 'module' object has no attribute 'Credentials'

  13. 13

    Why am i getting AttributeError: 'KerasClassifier' object has no attribute 'model'?

  14. 14

    AttributeError: 'function' object has no attribute

  15. 15

    AttributeError: 'bool' object has no attribute

  16. 16

    'module' object has no attribute 'SortedDict' Django Tastypie error

  17. 17

    AttributeError: 'datetime' module has no attribute 'strptime'

  18. 18

    theanoのインポート:AttributeError: 'module' object has no attribute 'find_graphviz'

  19. 19

    pythonエラー「AttributeError: 'module' object has no attribute 'sha1'」

  20. 20

    AttributeError: module 'win32ctypes.pywin32.win32api' has no attribute 'error'

  21. 21

    SQLAlchemy "AttributeError: 'str' object has no attribute 'c'"

  22. 22

    TensorFlow:AttributeError: 'Tensor' object has no attribute 'shape'

  23. 23

    Scrapy:AttributeError: 'list' object has no attribute 'iteritems'

  24. 24

    AttributeError: 'list' object has no attribute 'split'-Python

  25. 25

    AttributeError( "'str' object has no attribute 'read'")

  26. 26

    AttributeError: 'DeferredAttribute' object has no attribute '_meta'

  27. 27

    AttributeError( "'str' object has no attribute 'read'")

  28. 28

    AttributeError( "'str' object has no attribute 'read'")

  29. 29

    AttributeError: 'Snackbar' object has no attribute 'show'

ホットタグ

アーカイブ