Comments (2)
Hi,
Thanks for raising this issue :-) Yep I will try to do that soon.
It is actually due to the fact that the method expects a list of int as input.
Regards,
Robin
from hrv-analysis.
For those still waiting, you can fix it by simply casting the max and min values to int's (as range expects int values not floats). By doing something like:
def plot_distrib(nn_intervals, bin_length: int = 8):
"""
Function plotting histogram distribution of the NN Intervals. Useful for geometrical features.
Arguments
---------
nn_intervals : list
list of Normal to Normal Interval.
bin_length : int
size of the bin for histogram in ms, by default = 8.
"""
max_nn_i = max(nn_intervals)
min_nn_i = min(nn_intervals)
style.use("seaborn-darkgrid")
plt.figure(figsize=(12, 8))
plt.title("Distribution of Rr Intervals", fontsize=20)
plt.xlabel("Time (s)", fontsize=15)
plt.ylabel("Number of Rr Interval per bin", fontsize=15)
#Range expects an integer rather than a float
plt.hist(nn_intervals, bins=range(int(min_nn_i) - 10, int(max_nn_i) + 10, bin_length), rwidth=0.8)
plt.show()
from hrv-analysis.
Related Issues (20)
- Correct SD2/SD1 ratio to SD1/SD2 ratio HOT 3
- Wrong divisor in computing pnni_50/pnni_20 HOT 3
- test notif
- Calculating rr-interval list HOT 1
- Calculation of pNN50 wrong? HOT 4
- '>=' not supported between instances of 'int' and 'ellipsis' HOT 2
- Question of citation HOT 1
- Missing documentation HOT 2
- The issue about heart beat interval preprocessing for interpolation
- UserWarning from spectral.py when using get_time_domain_features HOT 1
- RuntimeError: implement_array_function method already has a docstring HOT 1
- Unit of nn_intervals
- is_outlier - returns true when it's not an outlier
- Suggestion - DFA α1 analysis ?
- interpolate_nan_values(rr_intervals=a) where a[0] is nan returns list with first index nan
- rr_intervals_without_outliers = remove_outliers(rr_intervals=rr_intervals_list,low_rri=300, high_rri=2000)
- [Request] Is it possible to get the LF at a 5 seconds or 1 second interval?
- The code is running with an error
- Cannot import LombScargle in extract_features.py HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hrv-analysis.