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 |
Tags
- matplotlib
- DataAccess
- Dictionary
- analizer
- pandas
- sklearn
- Python
- count()
- 덴드로그램
- function
- DataFrame
- numpy
- len()
- Machine Learning
- hierarchical_clustering
- IN
- append()
- string
- data
- dendrogram
- 최댓값
- nan
- 반복문
- elbow method
- 최솟값
- wcss
- insert()
- 분류 결과표
- list
- del
Archives
- Today
- Total
개발공부
[Python] List 특징, 생성, 오프셋으로 값 얻기 본문
>>> []
[]
>>> list()
[]
List
-데이터를 여러 개 저장하는데 사용합니다.
-순서가 있습니다. 즉, 인덱스를 가지고 있습니다.
-값을 바꿀 수 있습니다. 즉, mutable 이라고 합니다.
List 만들기
- []
- list()
>>> []
[]
>>> list()
[]
List offset으로 값 얻기
- [] 를 사용하여 값을 얻을 수 있다.
>>> week = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri']
>>> week
['Mon', 'Tue', 'Wed', 'Thu', 'Fri']
>>> week[1]
'Tue'
>>> week[-1]
'Fri'
>>> week[1 : 3 + 1]
['Tue', 'Wed', 'Thu']
- list 안의 list의 값또한 얻을 수 있다.
>>> my_list = ['Mitch', [3, 6, 7], ['yellow', 5, 6]]
>>> my_list[0]
'Mitch'
>>> my_list[1][1]
6
>>> my_list[2][0][-1]
'w'
'Python > Basic' 카테고리의 다른 글
[Python] List del, remove(), pop() (0) | 2022.04.20 |
---|---|
[Python] List 변경, append(), insert(), + (0) | 2022.04.20 |
[Python] String count(), in, startswith() (0) | 2022.04.20 |
[Python] String len(), find(), rfind() (0) | 2022.04.20 |
[Python] String 변경, replace() (0) | 2022.04.20 |