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
- nan
- count()
- matplotlib
- sklearn
- Dictionary
- del
- function
- 덴드로그램
- IN
- hierarchical_clustering
- string
- Python
- DataFrame
- pandas
- wcss
- list
- analizer
- dendrogram
- append()
- 분류 결과표
- 최솟값
- numpy
- data
- DataAccess
- elbow method
- insert()
- 반복문
- 최댓값
- Machine Learning
- len()
Archives
- Today
- Total
목록list comprehension (1)
개발공부
List Comprehension - 원본 리스트를 가지고, 다른 리스트를 만드는 방법이다. - for, while 없이 loop를 실행시키는 아름다운 방법이다. 예제 아래 for 문으로 만든 각리스트의 숫자를 7씩 뺀 리스트를 만드는 예제가 있다. >>> score_list = [ 88, 76, 56, 91, 68 ] >>> new_list = [] >>> for data in score_list : >>> new_list.append( data - 7 ) >>> new_list [81, 69, 49, 84, 61] 이를 list comprehension을 이용하면 아래와 같은 식으로 표현할 수 있다. >>> score_list = [ 88, 76, 56, 91, 68 ] >>> new_list = [..
Python/Basic
2022. 4. 26. 16:24