Skip to content Skip to sidebar Skip to footer

How To Dynamically Choose Row Labels Using Tabulate In Python

I have a dictionary where the keys are strings and the values are lists of integers. It is created as follows: table_dict_of_lists = {} for label in return_dict_keys: temp_lis

Solution 1:

The documentation never seems to suggest that row headers are supported in the library. Here's a possible workaround to at least get it to tabulate correctly:

f.write(tabulate(([k] + v for k, v in first_table.iteritems())))

Post a Comment for "How To Dynamically Choose Row Labels Using Tabulate In Python"