I am using Python 3
I used method numpy.random.normal() to generate normal distribution histogram and i was looking for a method to count numbers of elements between 2 data points. I have attached a snapshot as an example, and hatched with red the limits to find number of data points.
Can you please help me with an advice or a method
Looking forward for your response
just add together the datapoints in that range which you fed into the graph…?
or if you don’t mean sum then whatever operation
your graph is a list of numbers isn’t it?
May i share the code with you in order to have a better understanding what i am trying to get?
I have tried with range function
count = 0
for rest in range(Limit, int(Limit_min)):
count += rest
In this code block:
Limit = 0
Limit_min = is float number and convert it to integer
The code display 0 and data points within this range should be greater then 0 because Limit_min is - 0,038.
Is there any function in numpy to count number of datapoints between 2 limits?
not sure why you’d need numpy for that. look at each datapoint and compare its x value to your range
converting to int definitely doesn’t help you, that just means losing accuracy on where the range begins and ends
I have tried many solution did not succeed to count numbers of observation between 0 and Limit_min.
Please help me to find a solution or any other method how to count data_points in an array.