Hello,
I would like to add borders to specific cells and when adjacent, border the group without internal borders. Here is my code so far...
import pandas as pd
df = pd.DataFrame({"TransNo":[29, 32, 34, 45, 68, 71, 72, 73, 81],
"Type":["Fee", "Sale", "Fee", "Fee", "Sale", "Sale", "Sale", "Sale", "Fee"],
"Amount": [1.2, 10.2, 2.1, 3.1, 15.3, 19.2, 100.5, 97.3, 2.2]})
def border(cell_value):
if cell_value == "Sale":
return "border: solid thin"
df.style.applymap(border)
and here is the output...

and here is the markup of the desired output....

The red markup indicating the deletion of internal lines. Any pointers would be appreciated. Thank you.
Tyler