Issues with download button

Hey all! I’m trying to implement the download button component on my streamlit app but I’m getting this error:

RuntimeError: Invalid binary data format: <class 'pandas.core.frame.DataFrame'>


File "", line 302, in <module>
File ".pyenv/virtualenvs/streamlit-service/3.8.6/lib/python3.8/site-packages/streamlit/elements/", line 211, in download_button
File "/Users/jillcates/.pyenv/virtualenvs/streamlit-service/3.8.6/lib/python3.8/site-packages/streamlit/elements/", line 313, in marshall_file
    raise RuntimeError("Invalid binary data format: %s" % type(data))

Dataframe renders properly in app, but for some reason it doesn’t work with the download button? Anyone else come across this?