Notice
Recent Posts
Recent Comments
Link
250x250
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- Ai
- dataset
- Self-attention
- AI Math
- 딥러닝
- seaborn
- word2vec
- 2023 현대차·기아 CTO AI 경진대회
- RNN
- 데이터 시각화
- Bart
- Attention
- pyTorch
- Transformer
- matplotlib
- Optimization
- KLUE
- Bert
- Data Viz
- passage retrieval
- 기아
- mrc
- 데이터 구축
- nlp
- ODQA
- N21
- GPT
- AI 경진대회
- 현대자동차
- N2N
Archives
- Today
- Total
쉬엄쉬엄블로그
Python set 본문
728x90
s1 = {1, 2, 3, 4, 5}
s2 = {3, 4, 5, 6, 7}
s1 & s2 == s1.intersection(s2) == s2.intersection(s1)
=> s1과 s2의 교집합을 반환
=> {3, 4, 5}
s1 | s2 == s1.union(s2) == s2.union(s1)
=> s1과 s2의 합집합을 반환
=> {1, 2, 3, 4, 5, 6, 7}
s1 - s2
=> s1과 s2의 차집합
=> {1, 2}
s2 - s1
=> s2와 s1의 차집합
=> {6, 7}
s1.update( {8, 9} )
=> s1에 여러 원소 추가
=> s1 : {1, 2, 3, 4, 5, 8, 9}
'코딩' 카테고리의 다른 글
Python pandas dataframe groupby, groups, isin (0) | 2022.05.18 |
---|---|
Python collections (0) | 2022.04.14 |
Python permutations (2) | 2022.04.11 |
Python PriorityQueue (0) | 2022.04.09 |
Python any(), all() (0) | 2022.04.02 |
Comments