简体   繁体   English

为什么导入“emd”而不导入“EMD”?

[英]Why does "emd" get imported but not "EMD"?

I'm trying to import EMD from the PyEMD package. But I'm facing a peculiar issue.我正在尝试从 PyEMD package 导入 EMD。但我遇到了一个特殊问题。

When I write everything in small-case ie "emd" & "pyemd", it works but as per the desired case ie "EMD" & "PyEMD", it doesn't work.当我用小写形式(即“emd”和“pyemd”)编写所有内容时,它可以工作,但根据所需的情况,即“EMD”和“PyEMD”,它不起作用。

!pip install pyemd
from pyemd import emd

#Output:
Requirement already satisfied: pyemd in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (0.5.1)
Requirement already satisfied: numpy<2.0.0,>=1.9.0 in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from pyemd) (1.23.3)
!pip install PyEMD
from PyEMD import EMD

#Output:
Requirement already satisfied: PyEMD in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (0.5.1)
Requirement already satisfied: numpy<2.0.0,>=1.9.0 in /anaconda/envs/azureml_py38/lib/python3.8/site-packages (from PyEMD) (1.23.3)
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Input In [9], in <cell line: 2>()
      1 get_ipython().system('pip install PyEMD')
----> 2 from PyEMD import EMD

ModuleNotFoundError: No module named 'PyEMD'

The problem is that both these functions "emd" and "EMD" expect different kinds of input arguments, hence they aren't the same function. I require only "EMD" for my use.问题是“emd”和“EMD”这两个函数都需要不同类型的输入 arguments,因此它们不是相同的 function。我只需要“EMD”供我使用。

So, how exactly do we import EMD from PyEMD?那么,我们究竟如何从 PyEMD 中导入 EMD?

It looks like you're mixing two different packages presumably both offering related capabilities.看起来您正在混合两个不同的包,大概都提供相关功能。

pip install pyemd installs pyemb : https://pypi.org/project/pyemd/ by WMayner: https://github.com/wmayner/pyemd pip install pyemd安装pyembhttps://pypi.org/project/pyemd/ WMayner: https://github.com/wmayner/pyemd

For EMD like you want, you probably need pip install EMD-signal to get the package by Dawid Laszuk: https://pyemd.readthedocs.io/en/latest/intro.html https://github.com/laszukdawid/PyEMD对于您想要的EMD ,您可能需要pip install EMD-signal才能获得 Dawid Laszuk 的 package: https://pyemd.readthedocs.io/en/latest/intro.html https /githubPydaw/com

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM