Hi!
I am trying to style a dataframe. The code works on jupyter notebook but when I try to display the dataframe on the streamlit app I have an error.
The code I use:
def highlight(cell):
if type(cell) == str and cell == ‘rouge’ :
return ‘background: darkred; color:black’
elif type(cell) == str and cell == ‘vert’ :
return ‘background: darkgreen; color:black’
st.dataframe(newdf.style.applymap(highlight))
The error I have:
TypeError: _translate() missing 2 required positional arguments: ‘sparse_index’ and ‘sparse_cols’
Any suggestion of how to solve this error would be appreciated, thank you