일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- with
- c++11
- List
- pi
- Shader
- SVN
- boost
- C++
- autovacuum
- expect
- sql
- awk
- postgresql
- Eclipse
- ubuntu
- null
- SSH
- mysql
- if
- Unity
- conda
- pandas
- 쉘
- 배열
- ngui
- DROP
- python
- sqlite
- dataframe
- FIND
Archives
- Today
- Total
목록List (2)
その先にあるもの…
[PYTHON] 리스트 합집합, 교집합, 차집합, 대칭차
list1 = ['A', 'B', 'C', 'D'] list2 = ['C', 'D', 'E', 'F'] [1, 2, 3, 4, 5, 6, 7, 8, 9] 합집합 union = list( set(list1) | set(list2) ) print( union ) [1, 2, 3, 4, 5, 6, 7, 8, 9] union = list( set().union(list1, list2) ) print( union ) [1, 2, 3, 4, 5, 6, 7, 8, 9] 교집합 intersection = list( set(list1) & set(list2) ) print( intersection ) [5] intersection = list( set(list1).intersection( list2 ) ) print( ..
프로그래밍/Python
2020. 6. 26. 16:13