I have a pandas.DataFrame df as:
>>> df = pd.DataFrame([[1,2,2,2,3], [1,2,3,3,3],[1,3,2,3,5],[7,9,9,3,2]], columns=list("ABCDE"))
I want to achieve this type of table in html (with control of which cells I can merge)
I know that it can be achieved manipulating the table obtained from df.to_html() function and using jquery to expand the rowspans, yet I'm asking about the pythonic way to do it, i.e. is there a possible way of obtaining the merged table directly from some sort of pivot table / dataframe.
I thought about temporary setting the columns to merge as indexes in multi indexed data frame, however this approach is.. crude, to say the least.
It would be perfect if I had the full control of which cells can I merge, based on, for example, values of other cells in the same row.