I have a data frame, df, as below:
| Name | Day |
|---|---|
| Bob | Monday |
| John | Thursday |
| Sam | Friday |
| Bob | Monday |
| Katie | Sunday |
| Kyle | Tuesday |
| Katie | Saturday |
| Bob | Wednesday |
| Katie | Sunday |
| Sam | Thursday |
| Joe | Friday |
The following code highlights entire rows given how often a name occurs within the Name Column:
cmap = {1: 'green', 2: 'yellow', 3: 'red'}
freq = df['Name'].map(df['Name'].value_counts())
colors = freq.map(cmap).radd('background-color: ')
df.style.apply(lambda s: colors)
However when I use .render() in order to convert the styler object to html to send in an email, there is no boarder in the table. How do you keep a boarder when converting a dataframe to a styler object then to an HTML table?