'Python create html table from dict of lists
So i wrote some script that query some information from Elasticsearch, I collect all the necessary data and store it in dict of lists. I want to send it to developers using html table (important note not all of the values has the same length). this is what i tried:
df = pd.DataFrame.from_dict(dict_of_lists, orient='index')
df.to_html('result.html')
The problem that i have many cells that are empty.
if anyone have different approach instead of using pandas i will be glad to hear ps example of data structure:defaultdict(<class 'list'>, {'reports': ['status code: 401, line: Unauthorized'], 'metrics': ['failed sending to code: 401, line: Unauthorized', "Network Error"],
(as you can see that they dont have the same length)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
