-
Jupyter-결측값Cording/Python 2021. 1. 3. 05:24
from pandas import DataFrame
df=DataFrame(~)
df.sum()
df.mean()
df.describe()
df.cumsum() # 누적 합계
df.sum(axis=1) # series 형태로 생성
df.거래처.unique() # 순수
df.['거래처'].value_counts()
import numpy as np
import pandas as pd
df=pd.DataFrame(np.ones((4,4)),index=['a','b','c','d'])
df
df[1]['b']=np.nan
df[3]['b':]=np.nan
df
pd.isnull(df)
pd.notnull(df)
df[3].isnull().sum()
df2=df.dropna()
df2
df3=df.dropna(how='all')
df3
df.fillna(1)
df.fillna({1:3,3:7}) # 결측치를 다른 숫자로 변환.
df.fillna('unknown')
'Cording > Python' 카테고리의 다른 글
Jupyter-data filtering (0) 2021.01.09 Jupyter_CSV (0) 2021.01.07 Jupyter-Dataframe(2) (0) 2020.12.30 Jupyter-Dataframe (0) 2020.12.28 Jupyter-Series (0) 2020.12.26