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 :: sort a list of array python 
Python :: tower of hanoi python 
Python :: get name of variable python 
Python :: reload flask on change 
Python :: how to make a distance function in python 
Python :: print current line number python 
Python :: logging - multiple log file 
Python :: python create file if doesnt exist 
Python :: pandas return specific row 
Python :: seaborn boxplot 
Python :: DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel(). y = column_or_1d(y, warn=True) 
Python :: str to tuple of float 
Python :: remove last line of text file python 
Python :: Python list of dictionaries search 
Python :: python convert date to timestamp 
Python :: for i 
Python :: django logout page 
Python :: python return specific elements from list 
Python :: python how to make notepad 
Python :: sort columns dataframe 
Python :: doc2vec similarity 
Python :: scaling data 
Python :: check remote port is open or not using python 
Python :: keep only one duplicate in pandas 
Python :: Pyspark Aggregation on multiple columns 
Python :: pygame mirror image 
Python :: heatmap of pandas dataframe with seaborn 
Python :: how to run .exe from python 
Python :: get token from request django 
Python :: dataframe time index convert tz naive to tz aware 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =