forrestbao / pyeeg

Python + EEG/MEG = PyEEG
GNU General Public License v3.0
241 stars 85 forks source link

NameError: global name 'np' is not defined #14

Closed luiscruz closed 8 years ago

luiscruz commented 8 years ago

I have installed pyeeg using pip. This is my line in requirements.txt:

-e git+https://github.com/forrestbao/pyeeg.git#egg=pyeeg

When I use pyeeg.ap_entropy I am encountering the following error:

NameError: global name 'np' is not defined

I have numpy installed, I'm importing it as np, and it works fine. Do you have any idea what this might be?

Thanks!

luiscruz commented 8 years ago

I'm trying to run it using an ipython notebook

luiscruz commented 8 years ago

I guess here https://github.com/forrestbao/pyeeg/blob/master/pyeeg/__init__.py#L532 The code should consistently use numpy instead of np.

Borzou commented 8 years ago

Hi Luis,

Yes you are right. It seems that I missed changing nps in the sample entropy and the approximate entropy. Will fix that asap. Thanks for sharing it. In the meanwhile you can fix them for your own project. Please let us know if you find any other problems.

Thanks, Best Wishes, Borzou

On Tuesday, January 5, 2016, Luis Cruz notifications@github.com wrote:

I guess here https://github.com/forrestbao/pyeeg/blob/master/pyeeg/__init__.py#L532 The code should consistently use numpy instead of np.

— Reply to this email directly or view it on GitHub https://github.com/forrestbao/pyeeg/issues/14#issuecomment-168972334.

luiscruz commented 8 years ago

Will do! Thank you @Borzou

ErikHendriks commented 6 years ago

Or you could import numpy like this import numpy as np