#5, First Floor, 4th Street , Dr. Subbarayan Nagar, Kodambakkam, Chennai-600 024 pro@slogix.in

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • pro@slogix.in
  • +91- 81240 01111

Social List

How to detect outliers in independent variable using seaborn library in python?
Description

To detect outliers in a input variable(X) using python.

Process

  Import library functions.

  Read the data set.

  Use sns.boxplot() from seaborn library.

  Pass the input variable to the ().

Sapmle Code

Single variable box plot

#import library functions

import seaborn as sns

import pandas as pd

#Read the data set

data=pd.read_csv(‘/home/soft27/soft27

/Sathish/Pythonfiles/Employee.csv’)

#create data frame

df=pd.DataFrame(data)

#use box plot functions

sns.boxplot(df[‘age’])

sns.despine()

#Multi variable box plot

#import library functions

import seaborn as sns

import pandas as pd

#Read the data set

data=pd.read_csv(‘/home/soft27/soft27

/Sathish/Pythonfiles/Employee.csv’)

#create data frame

df=pd.DataFrame(data)

#use box plot functions

sns.boxplot(df[‘age’],df[‘salary’])

sns.despine()

Screenshots