Research breakthrough possible @S-Logix pro@slogix.in

Office Address

  • 2nd Floor, #7a, High School Road, Secretariat Colony Ambattur, Chennai-600053 (Landmark: SRM School) Tamil Nadu, India
  • 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 ().

Sample 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
detect outliers in independent variable
import pandas as pd