collections.abc
2024.04.15 - [분류 전체보기] - [Python] collections.abc
[Python] collections.abc
2023.10.06 - [Pages] - [Python] Collections collections.abc 와 Python의 DataStructure. Python의 Data structure는 실제적으로 collections.abc 라는 abstract base class (abc) mechanism를 통한 hierarchy로 구성된다. 일반적으로 list, tuple
ds31x.tistory.com
list (sequence type)
2023.07.12 - [Python] - [Python] list (sequence type) : summary
[Python] list (sequence type) : summary
list는 ordered mutable collection으로, collection을 위한 python data type들 중 가장 많이 사용된다. C에서의 array와 같이 가장 기본적인 collection임. 단, heterogeneous item을 가질 수 있으며, 여러 methods를 가지는
ds31x.tistory.com
2023.07.17 - [Python] - [Python] List's methods
[Python] List's methods
일반적으로 object에 대해 method를 호출할 경우, 해당 object의 관련 attribute의 값이 바뀌고 None을 반환하는 경우가 많다. (단, NumPy나 Pandas 등의 경우, 해당 object의 값을 바꾸면서 바뀐 object의 참조를
ds31x.tistory.com
tuple
2023.10.06 - [Python] - [Python] tuple
[Python] tuple
Tuple은 immutable list 라고 자주 불릴 정도로 list와 유사하다. immutable이기 때문에 한번 assign된 이후 item의 update는 불가함. update가 안되기 때문에 list 보다 적은 수의 methods를 제공. 때문에 보다 적은 m
ds31x.tistory.com
set and frozenset
2023.07.12 - [Python] - [Python] set and frozenset
[Python] set and frozenset
set(집합) : 특정 conditions를 만족시키는 구별 가능한(distinct) object의 collection. set의 중요한 수학적 특징은 특정 object가 set에 속하는지 아닌지를 명확히 판별(특정 conditions에 의해)할 수 있음. set에
ds31x.tistory.com
dictionary (mapping type)
2023.07.11 - [Python] - [Python] dictionary (Mapping type) : basic
[Python] dictionary (Mapping type) : basic
Python에서 dictionary는 key-value pair를 item으로 가지는 unordered mutable collection임. set과 함께 curly bracket (or brace)를 사용하는데, empty dictionary가 바로 {}로 표현됨 (dictionary가 set보다 많이 이용되는 점이 반
ds31x.tistory.com
2023.07.11 - [Python] - [Python] Dictionary's methods
[Python] Dictionary's methods
비우기 dic.clear() Dictionary instance (or object) dic을 전부 비움. 모든 key-value 쌍들이 제거됨. 값 얻어오기 dic.get(key) key에 해당하는 키를 가지고 있는 value를 반환. 만약 없다면 None이 반환됨. dic[key]와 같
ds31x.tistory.com
Comprehesion
https://dsaint31.tistory.com/500
[Python] List Comprehension
List comprehension is an expression(표현식) that transforms a collection (not necessarily a list) into a list. list를 생성하는 expression 으로, 원본이 되는 collection 의 모든 item 혹은 일부 item들에 대해 같은 operation을 적용
dsaint31.tistory.com
Iterable and Iterator, and Generator
https://dsaint31.tistory.com/501
[Python] Iterable and Iterator, plus Generator
Iterable for 문에서 in 뒤에 위치하여 iterate (반복, 순회)가 가능한 object를 가르킴. __iter__() 라는 special method를 구현하고 있으며, 이를 통해 자신에 대한 iterator object를 반환할 수 있음. __iter__() special
dsaint31.tistory.com
'Pages' 카테고리의 다른 글
[Python] String : 문자열 (1) | 2023.10.06 |
---|---|
[Python] Control Structure and Control Flow (1) | 2023.10.06 |
[Python] function 과 Scope, Name Space 정리 (0) | 2023.10.06 |
Shell 관련 정리 (0) | 2023.10.02 |