1. 결측치 (Missing Value, Not Available)
1.1 결측치 확인
import numpy as np
a = np.array([1,np.nan])
np.isnan(a)
- Pandas
- Series
- Series객체.isnull()
- Series.notnull()
- DataFrame
- DataFrame객체.isnull(), DataFrame객체.isna()
- DataFrame객체.notnull(), DataFrame객체.notna()
1.1.1 TODO
s1.shape, s1.size
s1.count()
s1.isnull()
s1.notnull()
s1.isnull().sum()
1.2 결측치 처리
1.2.1 TODO
s2.dropna()
s2.dropna(inplace=True)
s2
s1.fillna(8008)
mean_value = np.round(s1.mean())
s4 = s1.fillna(mean_value)
s4
s5 = pd.Series(['A','A','AB','O',None, 'B'])
s5.mode()
s5.fillna(s5.mode()[0])
s5.fillna(method='ffill')
s5.fillna(method='bfill')