程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

[Python data visualization] 02 Chapter 4 data cleaning

編輯:Python

Python Data cleaning

The purpose of data cleaning is to improve data quality
Pandas Common data cleaning in Handling of null and missing values Processing of duplicate values Handling of outliers

Null and missing values

  • A null value generally indicates that the data is unknown Not applicable or add data later
  • Missing values are incomplete values for one or more attributes in the dataset

stay Pandas Provides functions for checking or handling null and missing values ,
among
isnull( ) and notnull ( ) Function can determine whether there are null and missing values .
For missing data have access to dropna( ) and fillna( ) Method to delete and populate

from pandas import DataFrame ,Series
import pandas as pd
from numpy import NAN
series_obj = Series([1,None,NAN])
pd.isnull(series_obj) # Check Whether it is null or missing 

This code means , Created a Series object , Object contains 1 . None NAN Three values
And then call isnull() Function check
The first is normal , The last two are missing

notnull( ) function

seeing the name of a thing one thinks of its function Empathy

dropna() Method

dropna Delete rows and columns with null or missing values

About His grammar


He has four parameters
The first two parameters Is to see whether to delete rows and columns
The last two parameters See the filtering standard


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved