MoonNote

파이썬(Python)에서 모든 조합 구하기 본문

Study/Python

파이썬(Python)에서 모든 조합 구하기

Kisung Moon 2021. 7. 14. 10:51
from itertools import combinations

features = ['GzmB1', 'age', 'Mean_pack_years', 'ANC', 'ALC', 'NLR', 'CRP', 'CEA', 'sex', 'smoking']
features_combination = []

# feature의 모든 조합을 구하기(1~10개)
for i in range(1, len(features) +1 ):
    features_combination += list(combinations(features, i))

print(features_combination)

'Study > Python' 카테고리의 다른 글

주소  (0) 2021.09.09
EDA library 추천: pandas-profiling  (0) 2021.08.20
pandas: 특정 조건의 row를 drop하기  (0) 2021.07.17
pandas: 조건 일치하는 dataframe 출력  (0) 2021.07.16
한 개의 축에 여러 개 변수 시각화하기  (0) 2021.07.06