Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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.

When I write everything in small-case i.e. "emd" & "pyemd", it works but as per the desired case i.e. "EMD" & "PyEMD", it doesn’t work.

!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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

So, how exactly do we import EMD from PyEMD?

>Solution :

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

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

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading