How to extract from a list(combinations())

Viewed 24

I am sorry ahead of time if this is a duplicate question. Code:

 sample_list = [various data frame column names in here 50 total]
    list_combinations = list()
    sample_set = set(sample_list)
    for n in range(4):#len(sample_set) + 1
        list_combinations += list(combinations(sample_set, n))

I have a

 list_combinations += list(combinations(sample_set, n))

when I display:

 display(list_combinations[20001]) 

I get:

 ('UTILITIES-FIXED COSTS',
     'FIXED CHANGE IN INV - OTHER (30%)',
     'TOTAL OTHER EXPENSE')

What I want to do is get these all separate so I can plug it back into my dataframe for variance_inflation_factor analysis.:

 df['UTILITIES-FIXED COSTS','FIXED CHANGE IN INV - OTHER (30%)','TOTAL OTHER EXPENSE']

The issue is it is a list full of tuples when i want to break down the tuples into individual parts.

0 Answers
Related