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

Error of "unsupported operand type(s) for -: 'list' and 'list'" #22

Open
tdingquan opened this issue Jan 13, 2022 · 2 comments
Open

Error of "unsupported operand type(s) for -: 'list' and 'list'" #22

tdingquan opened this issue Jan 13, 2022 · 2 comments

Comments

@tdingquan
Copy link

When using min-max method on ECG data, we will encounter error of "unsupported operand type(s) for -: 'list' and 'list'".

Line 10, forecast_dataloader.py

@Fadegentle
Copy link

Maybe the coder forgot to turn the list into numpy.ndarray, because he just use the z_score with data = (data - mean) / std. The data is numpy.ndarray, so it actually turns into - operand of numpy.ndarray.

So you can try
scale = np.array(norm_statistic['max']) - norm_statistic['min'] + 1e-5
instead of
scale = norm_statistic['max'] - norm_statistic['min'] + 1e-5

This is a useful trick.

@tdingquan
Copy link
Author

Correct. I chose to turn the list into numpy.array before the - operation.

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

2 participants