Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

numpy select elements from array condition

import numpy as np

data = np.array([150000, 125000, 320000, 540000, 200000, 
                 120000, 160000, 230000, 280000, 290000, 300000, 
                 500000, 420000, 100000, 150000, 280000])

stdev = data.std()
aver = data.mean()
lower = aver-stdev
upper = aver+stdev
onestdev = data[(data<upper) & (data>lower)]
 
PREVIOUS NEXT
Tagged: #numpy #select #elements #array #condition
ADD COMMENT
Topic
Name
7+6 =