I've got a list and a nested list with the following formats:
list_of_groups = [ 'group1', 'group2', ... , 'group59', 'group60'] # Made up of 60 elements
nested_hosts = [['hosta_grp1', 'hostb_grp1', 'hostc_grp1'], ['hosta_grp2', 'hostb_grp2'], ... ,['hosta_grp60', 'hostb_grp60', 'hostc_grp60]] # Made up of 60 nested lists all of different number of elements
I am trying to create a dataframe using pandas so that I can see the data above in the following way:
group1 group2 ...... group59 group60
hosta_grp1 hosta_grp2 hosta_grp59 hosta_grp60
hostb_grp1 hostb_grp2 hostb_grp59 hostb_grp60
hostc_grp1 hostc_grp59 hostc_grp60
hostd_grp59
I've tried the above using this code:
df = pd.DataFrame(nested_hosts, columns = list_of_groups)
And I get this error:
60 columns passed, passed data had 2367 columns.