Renu Khandelwal
1 min readAug 6, 2019

--

Hello Jayesh,

def detect_outlier_row(data_1):

threshold=3
mean_1 = np.mean(data_1)
std_1 =np.std(data_1)
outlier_data=[]
outlier_row=[]

for i in range(len(data_1)):
z_score= (data_1[i] - mean_1)/std_1
if np.abs(z_score) > threshold:
outlier_data.append(data_1[i])
outlier_row.append(i)

return outlier_data, outlier_row

This function will identify the presence of outliers, the outlier values as well as the outlier rows in the dataset.

For visualization of outliers you can use box plots

Hope this helps…

--

--

Renu Khandelwal
Renu Khandelwal

Written by Renu Khandelwal

A Technology Enthusiast who constantly seeks out new challenges by exploring cutting-edge technologies to make the world a better place!

Responses (1)