Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

outliers removal

#Removing outliers first then skewness
from scipy.stats import zscore
z=abs(zscore(df))
print(z.shape)
df=df[(z<3).all(axis=1)]
df.shape
Comment

outlier removal

q1 = df['column'].quantile(0.25)
q3 = df['column'].quantile(0.75)
iqr = q3 - q1

df.loc[df['column'] > (q3 + 1.5 * iqr) | df['column'] < (q1 - 1.5 * iqr), 'column'] = df['column'].mean()
Comment

PREVIOUS NEXT
Code Example
Python :: run calc.exe inside python 
Python :: append dataframe pandas 
Python :: print list in python 
Python :: how to update list in python 
Python :: pdf to csv python 
Python :: run python notepad++ 
Python :: datafram combine 3 columns to datetime 
Python :: how to aggregate multiple columns in pyspark 
Python :: WebDriverWait 
Python :: python remove suffix 
Python :: how to check for missing values in pandas 
Python :: concatenate python 
Python :: 3d array python numpy 
Python :: declare empty array of complex type python 
Python :: python numpy array size of n 
Python :: pytorch unsqueeze 
Python :: convert list to numpy array 
Python :: calculate mean on python 
Python :: view all columns in pandas dataframe 
Python :: filter one dataframe by another 
Python :: remove keys from array python 
Python :: numpy array with 2 times each value 
Python :: check if a string is float python 
Python :: dt.weekday_name 
Python :: validity of password in python 
Python :: slicing of tuple in python 
Python :: dataset for cancer analysis in python 
Python :: pyspark print a column 
Python :: python super 
Python :: measure time 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =