Suppose we have a list of lists with 5 lists:
master_list = [list1, list2, list3, list4, list5]
I want to get the column names to be:
cols = ["list1", "list2", "list3", "list4", "list5"]
How could I extract these names from master_list?
Edit. I guess you can manually add quotations to the elements of cols list and then if you wanted to create a dataframe, do something like:
import pandas as pd
df_output = pd.DataFrame(list(zip(list1, list2, list3, list4, list5 )),
columns =cols)