I tried to use this code from this discussion (How to add WordCloud graph in Streamlit - #2 by Amanda_Kelly)
import streamlit as st
from wordcloud import WordCloud
import matplotlib.pyplot as plt
# Create some sample text
text = 'Fun, fun, awesome, awesome, tubular, astounding, superb, great, amazing, amazing, amazing, amazing'
# Create and generate a word cloud image:
wordcloud = WordCloud().generate(text)
# Display the generated image:
plt.imshow(wordcloud, interpolation='bilinear')
plt.axis("off")
plt.show()
st.pyplot()
However, it is not working, it shows the following error: “TypeError: expected string or bytes-like object”.
Could you help me to solve this?