Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
Tags
- 반복문
- analizer
- Python
- pandas
- 최댓값
- list
- function
- insert()
- dendrogram
- Machine Learning
- elbow method
- 분류 결과표
- DataFrame
- count()
- DataAccess
- string
- IN
- del
- hierarchical_clustering
- wcss
- data
- append()
- Dictionary
- nan
- 최솟값
- len()
- sklearn
- 덴드로그램
- matplotlib
- numpy
Archives
- Today
- Total
목록groupby (1)
개발공부
groupby() 카테고리컬 데이터의 각 데이터별로 묶어서 처리하는 방법 카테고리컬 데이터인지 알 수 있는 방법은 nunique()와 unique()를 이용하면 된다. # 카테고리컬 데이터 (Categorical Data) # 갯수가 정해져있고 그 안에서 나눌 수 있는 것 >>> df['Year'].nunique() 3 >>> df['Year'].unique() array([1990, 1991, 1992], dtype=int64) df의 행갯수는 8개인데 Year 컬럼의 유니크한 갯수는 3개이다. 그러므로 Year의 데이터는 카테고리컬 데이터이다. # 각 년도'별로' 연봉 총합 구하라 >>> df.groupby('Year')['Salary'].sum() Year 1990 153000 1991 162000..
Python/Pandas
2022. 5. 3. 12:56