반응형
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 |
Tags
- array
- django
- numpy
- Github
- google apps script
- PySpark
- SQL
- c#
- Tkinter
- PostgreSQL
- Google Excel
- GIT
- PANDAS
- string
- dataframe
- Google Spreadsheet
- matplotlib
- list
- Java
- math
- hive
- Kotlin
- 파이썬
- Apache
- Redshift
- Python
- gas
- Mac
- Excel
Archives
- Today
- Total
목록intersection (1)
달나라 노트
Python Basic : set.intersection (set 교집합 구하기)
intersection intersection은 python의 collection중 하나인 집합을 다루는 set의 교집합을 반환합니다. 아래 예시는 set_1과 set_2의 교집합을 구하는 예시입니다. set_1 = {1, 2, 3, 4, 5} set_2 = {2, 3, 5, 6, 8} print(set_1) print(set_2) x = set_1.intersection(set_2) print(x) - Output {1, 2, 3, 4, 5} {2, 3, 5, 6, 8} {2, 3, 5} set_1과 set_2의 공통 요소인 2, 3, 5만 교집합으로서 반환되었음을 알 수 있습니다.
Python/Python Basic
2020. 11. 23. 18:01