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…

Loves learning, sharing, and discovering myself. Passionate about Machine Learning and Deep Learning

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store