neuropsychology / NeuroKit.py

A Python Toolbox for Statistics and Neurophysiological Signal Processing (EEG, EDA, ECG, EMG...).
http://neurokit.rtfd.io
MIT License
367 stars 103 forks source link

TypeError: 'str' object is not callable #96

Open anandketki95 opened 5 years ago

anandketki95 commented 5 years ago

I am getting type error while using bio_process. Below is my code. "i = 1 bio = nk.bio_process(ecg=df_respiban[i][:]['ECG'],rsp=df_respiban[i][:]['RESP'], ecg_quality_model=None, ecg_filter_frequency=[1,35], sampling_rate=100)"

Error is as follows,

~\Anaconda3\lib\site-packages\nolds\measures.py in sampen(data, emb_dim, tolerance, dist, debug_plot, debug_data, plot_file) 762 # successively calculate distances between each pair of template vectors 763 for i in range(len(tVecsM) - 1): --> 764 dsts = dist(tVecsM[i + 1:], tVecsM[i]) 765 if debug_plot: 766 plot_data[-1].extend(dsts)

TypeError: 'str' object is not callable find below attachment.

Untitled9.pdf

DominiqueMakowski commented 5 years ago

Hi @anandketki95, could you provide or send me your data or a sample of it so I can try reproducing the error? Thanks!

aravali324 commented 5 years ago

Hello , When i run the default example provided in documentation, i am facing the same problem

Download data

df=pd.read_csv("https://raw.githubusercontent.com/neuropsychology/NeuroKit.py/master/examples/Bio/bio_100Hz.csv")

Plot it

df.plot()

Process the signals

bio = nk.bio_process(ecg=df["ECG"], rsp=df["RSP"], eda=df["EDA"], add=df["Photosensor"],sampling_rate=100)

Plot the processed dataframe, normalizing all variables for viewing purpose

nk.z_score(bio["df"]).plot()

TypeError: 'str' object is not callable

matrach commented 5 years ago

Hi,

the issue is because nolds deprecated passing dist as string to measures.sampen and removed it in 0.5.0. The issue is located here. Just pass nolds.measures.rowwise_chebyshev instead.

As a quickfix, one may install an old version of nolds: pip install 'nolds<0.5'