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

后端 未结 2 561
孤街浪徒
孤街浪徒 2021-01-04 00:36

In scipy, the error occurs quite often.

>>> import scipy
>>> scipy.integrate.trapz(gyroSeries, timeSeries)
Traceback (most recent call last         


        
2条回答
  •  清酒与你
    2021-01-04 01:08

    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

提交回复
热议问题