-
-
Notifications
You must be signed in to change notification settings - Fork 423
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
ecg_intervalrelated() output formatting #985
Comments
This code will fix this problem in the meantime
|
I am not sure I understood what's the issue is, could you paste an example of what the output is currently and how it could be improved? |
The dataframe that is returned by ecg_intervalrelated() has columns that are arrays of arrays, i.e. each cell is formatted like [[value]]. So when we call
we get numpy.ndarray but in the ECG_Rate_Mean column
we get numpy.float64 Many functions want the data of a column to be formatted like the latter. For example, calling pandas plotting functions:
runs just fine, whereas
returns this error:
|
So the goal would be to make all the columns look like the ECG_Rate_Mean column
looking at the source code, I believe this function in ecg_intervalrelated() is our culprit
I think the double brackets around results[[column]].values may be the problem. I can fork and test it out this afternoon. |
fixed this! If you approve, I can open a PR. Old:
New:
I just changed the last line of _ecg_intervalrelated_hrv():
|
Just wondering if anyone could explain the rationale for the current formatting output by ecg_intervalrelated, being the HRV features (columns) are series of arrays of arrays of single floats.
This prevents some dataframe functionality, e.g. quick plotting with df.HRV_MeanNN.plot(), but I wanted to know if there are other benefits to it that I'm not seeing. Thanks!
The text was updated successfully, but these errors were encountered: