결측치

Data Science/Data Analysis

데이터셋 결측치 대체하기(선형보간법, 평균대치법, fillna()..)

In [ ]: !pip install fancyimpute Collecting fancyimpute Downloading fancyimpute-0.7.0.tar.gz (25 kB) Preparing metadata (setup.py) ... done Collecting knnimpute>=0.1.0 (from fancyimpute) Downloading knnimpute-0.1.0.tar.gz (8.3 kB) Preparing metadata (setup.py) ... done Requirement already satisfied: scikit-learn>=0.24.2 in /usr/local/lib/python3.10/dist-packages (from fancyimpute) (1.2.2) Requir..

Python/Pandas

판다스 pandas (6) - isna( ), fillna( )

결손 데이터 처리하기¶ 머신러닝은 NaN 값을 처리하지 않으므로 다른 값으로 대체해야 함 결손 여부 확인: isna( ) 다른 값으로 대체: fillna( ) In [1]: import pandas as pd titanic_df = pd.read_csv('./titanic_train.csv') titanic_df Out[1]: PassengerId Survived Pclass Name Sex Age SibSp Parch Ticket Fare Cabin Embarked 0 1 0 3 Braund, Mr. Owen Harris male 22.0 1 0 A/5 21171 7.2500 NaN S 1 2 1 1 Cumings, Mrs. John Bradley (Florence Briggs Th... female ..

얆생
'결측치' 태그의 글 목록