I have a NumPy array of values. I want to count how many of these values are in a specific range say x<100 and x>25. I have read about the counter, but it seems to only be valid for specif values not ranges of values. I have searched, but have not found anything regarding my specific problem. If someone could point me towards the proper documentation I would appreciate it. Thank you
I have tried this
X = array(X)
for X in range(25, 100):
print(X)
But it just gives me the numbers in between 25 and 99.
EDIT
The data I am using was created by another program. I then used a script to read the data and store it as a list. I then took the list and turned it in to an array using array(r).
Edit
The result of running
>>> a[0:10]
array(['29.63827346', '40.61488812', '25.48300065', '26.22910525',
'42.41172923', '20.15013315', '34.95323355', '13.03604098',
'29.71097606', '9.53222141'],
dtype='<U11')
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…