How to add tooltip for st.dataframe?

How do I add tooltip to column in a dataframe using streamlit?

If I run this example:python - How to annotate labels when you hover over a pandas dataframe - Stack Overflow

import pandas as pd

foo = pd.DataFrame({
    'temp': ['message1', 'message2', 'message3'],
    'var2': [1, 2, 3],
    'col3': [4, 5, 6]

# Setup a DataFrame with corresponding hover values
tooltips_df = pd.DataFrame({
    'temp': ['i am message 1', 'i am foo', 'i am lala'],
    'var2': ' another random message',
    'col3': 'more random messages'

# Assign tooltips

t = st.empty()
t.dataframe( )

then I get error: ‘int’ object has no attribute ‘strip’

File "../venv/lib/python3.8/site-packages/streamlit/elements/", line 314, in _pandas_style_to_css
    declaration = css_property.strip() + ": " + css_value.strip()

Perhaps you could employ Plotly (still within Streamlit) for this? Please, refer to the corresponding page in Plotly’s documentation: DataTable Tooltips | Dash for Python Documentation | Plotly.

Hey there @endrem, did you solf your problem? I’m interested.