Data Preprocess & EDA(3) - Data Manipulation
2021. 1. 30. 10:26ㆍ[AI]/Data Science Fundamentals
<Learned Stuff>
Key points
- Data Manipulation
- 데이터를 쪼개서 내가 원하는 정보를 얻는 것
- pandas built-in functions (별도 페이지에 저장)
- concat/merge
- melt()
- groupby()
- set_index() / reset_index()
개념
- tidy data
- conditioning
- column swap
<New Stuff>
[Tidy Data]
- 데이터 형태 변환의 종류이며 데이터 시각화에 쓰이는 여러 라이브러리에 유용하게 쓰임 (ex. seaborn)
[Conditioning]
- if문처럼 column에 원하는 data를 추출할 때 쓰임
# ex.
bigger_than_50 = (df['rate'] > 50)
# rate 이라는 column에 있는 data 중 50 초과되는 것들만 저장!
[DataFrame 의 column 위치 바꿔주는 방법]
#ex.
# df
A B
0 1 2
1 3 4
df = df[['B', 'A']]
# A & B column swap! (괄호within 괄호)
728x90
'[AI] > Data Science Fundamentals' 카테고리의 다른 글
Data Preprocess & EDA(1) - EDA(Exploratory Data Analysis) (0) | 2021.01.30 |
---|---|
Data Preprocess & EDA(2) - Feature Engineering (0) | 2021.01.30 |
Data Preprocess & EDA(4) - Data Visualization (0) | 2021.01.30 |
Statistic(1) - Hypothesis Test(1) (0) | 2021.01.30 |
Statistic(2) - Hypothesis Test(2) (0) | 2021.01.30 |