Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

remove outliers numpy array

import numpy as np
from scipy import stats
a = np.array([1,1,1,1,1,1,1,1,1,100])
a_no_outliers = a[(np.abs(stats.zscore(a)) < 3)]
print(a_no_outliers)
out: array([1, 1, 1, 1, 1, 1, 1, 1, 1])
Comment

PREVIOUS NEXT
Code Example
Python :: how to convert tuple to int in python 
Python :: what is a cube minus b cube 
Python :: how to count non null values in pandas 
Python :: median absolute deviation scipy 
Python :: how to count number of unique values in a column python 
Python :: pyplot bar plot colur each bar custom 
Python :: click link selenium python 
Python :: how to get discord username nextcord interactions 
Python :: use of == python 
Python :: how to format integer to two digit in python 
Python :: django import csrf exemplt 
Python :: How to get current CPU and RAM usage in Python? 
Python :: scatter plot of a dataframe in python 
Python :: check string equal with regular expression python 
Python :: initialize array of natural numbers python 
Python :: blender python get selected object 
Python :: filter dataframe 
Python :: python trace table generator 
Python :: os listdir sort by date 
Python :: on click on image pygame 
Python :: change default python version 
Python :: python file location path 
Python :: How to Convert Strings to Datetime in Pandas DataFrame 
Python :: python defaultdict example 
Python :: python font family list 
Python :: python how to open a file in a different directory in mac 
Python :: sys.executable 
Python :: exec to return a value python 
Python :: How to install XGBoost package in python on Windows 
Python :: list adding to the begining python 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =