일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- mysql
- Queue
- join
- python
- collections
- itertools
- 조합
- import re
- Level2
- 코테
- sql
- coding test
- 코딩
- programmers
- lv4
- level4
- 프로그래머스
- 완전탐색
- 코딩테스트
- coding
- 연습문제
- lambda
- 시간복잡도
- counter
- cte
- 파이썬
- Stack
- time complexity
- BFS
- 데이터분석
- Today
- Total
목록cycle (1)
ror_coding
[Python] Permutations, Combination, Product (Itertools)
from itertools importpermutations (순열)combinations (조합)product (주어진 반복 가능한 객체(iterable)들로 만들 수 있는 모든 조합 반환)cycle from itertools import permutations as perm # 순열from itertools import combinations as comb # 조합from itertools import product # 모든 가능한 조합from itertools import cycle for p in perm(data): # 순열. (모든 경우의 수)for c in comb(data, 3): # 3개씩 조합.# productl = [(x, -x) for x in numbers] # [(4, -4), ..
Algorithm/Python
2024. 12. 4. 14:59