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 find and drop missing values in a data set using python?

Description

To find missing values in a data sample and drop those missing values in python.

Process

   Import pandas library, because the data pre processing is mostly done by using pandas function.

  Read the sample data.

  Make it as a data frame.

  Find the missing value and drop those samples using pandas inbuilt functions,df.isnull() and df.dropna().

  Whenever we using isnull(),it finds missing values in the data set.

  Whenever we using dropna(),it drop entire sample in a data set.

Sample Code

#import libraries

import pandas as pd

#Read the sample data

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

/Sathish/Pythonfiles/Houseprice.csv’)

#create data frame

df=pd.DataFrame(data)

print(“Actual data frame is:\n”,df)

#Find the missing values

print(“Find missing values”)

print(df.isnull())

#Drop the missing values(Nan)

print(“Drop missing values”)

print(df.dropna())

Screenshots
find and drop missing values in a data set using python
import libraries
Find the missing values