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

bio_intervalrelated.ipynb Error in example #990

Open
Trinitow opened this issue May 14, 2024 · 1 comment
Open

bio_intervalrelated.ipynb Error in example #990

Trinitow opened this issue May 14, 2024 · 1 comment

Comments

@Trinitow
Copy link

Trinitow commented May 14, 2024

When executing the example file bio_intervalrelated.ipynb

at the paragraph:

Process ecg

ecg_signals, info = nk.ecg_process(data["ECG"], sampling_rate=100)

nk.ecg_plot(ecg_signals[:3000], info)

the following error appears:


TypeError Traceback (most recent call last)
File ~/opt/anaconda3/lib/python3.9/site-packages/pandas/core/indexes/base.py:3621, in Index.get_loc(self, key, method, tolerance)
3620 try:
-> 3621 return self._engine.get_loc(casted_key)
3622 except KeyError as err:

File ~/opt/anaconda3/lib/python3.9/site-packages/pandas/_libs/index.pyx:136, in pandas._libs.index.IndexEngine.get_loc()

File ~/opt/anaconda3/lib/python3.9/site-packages/pandas/_libs/index.pyx:142, in pandas._libs.index.IndexEngine.get_loc()

TypeError: '(slice(None, None, None), None)' is an invalid key

During handling of the above exception, another exception occurred:

InvalidIndexError Traceback (most recent call last)
Input In [5], in <cell line: 4>()
1 # Process ecg
2 ecg_signals, info = nk.ecg_process(data["ECG"], sampling_rate=100)
----> 4 nk.ecg_plot(ecg_signals[:3000], info)

File ~/opt/anaconda3/lib/python3.9/site-packages/neurokit2/ecg/ecg_plot.py:120, in ecg_plot(ecg_signals, info)
107 ax1 = _signal_rate_plot(
108 ecg_signals["ECG_Rate"].values,
109 info["ECG_R_Peaks"],
...
5635 # if key is not a scalar, directly raise an error (the code below
5636 # would convert to numpy arrays and raise later any way) - GH29926
-> 5637 raise InvalidIndexError(key)

InvalidIndexError: (slice(None, None, None), None)
Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings...

Ohne Titel

The plot is incomplete

Copy link

welcome bot commented May 14, 2024

Hi 👋 Thanks for reaching out and opening your first issue here! We'll try to come back to you as soon as possible. ❤️ kenobi

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

1 participant