Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: 'str' object is not callable #96

Open
anandketki95 opened this issue Jun 1, 2019 · 3 comments
Open

TypeError: 'str' object is not callable #96

anandketki95 opened this issue Jun 1, 2019 · 3 comments

Comments

@anandketki95
Copy link

anandketki95 commented Jun 1, 2019

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
Copy link
Member

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

@aravali324
Copy link

aravali324 commented Jul 8, 2019

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
Copy link

matrach commented Jul 15, 2019

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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants